[llvm-branch-commits] [clang-tools-extra-branch] r354984 - Merging r354957:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 27 06:58:48 PST 2019


Author: hans
Date: Wed Feb 27 06:58:48 2019
New Revision: 354984

URL: http://llvm.org/viewvc/llvm-project?rev=354984&view=rev
Log:
Merging r354957:
------------------------------------------------------------------------
r354957 | ibiryukov | 2019-02-27 11:16:03 +0100 (Wed, 27 Feb 2019) | 11 lines

[clangd] Set thread priority on Windows

Reviewers: kadircet, gribozavr

Reviewed By: kadircet, gribozavr

Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58683
------------------------------------------------------------------------

Modified:
    clang-tools-extra/branches/release_80/   (props changed)
    clang-tools-extra/branches/release_80/clangd/Threading.cpp

Propchange: clang-tools-extra/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 27 06:58:48 2019
@@ -1 +1 @@
-/clang-tools-extra/trunk:351463,351466-351468,351531,351686,351738,351788,352040,352231,353327,353422,354505,354765
+/clang-tools-extra/trunk:351463,351466-351468,351531,351686,351738,351788,352040,352231,353327,353422,354505,354765,354957

Modified: clang-tools-extra/branches/release_80/clangd/Threading.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/branches/release_80/clangd/Threading.cpp?rev=354984&r1=354983&r2=354984&view=diff
==============================================================================
--- clang-tools-extra/branches/release_80/clangd/Threading.cpp (original)
+++ clang-tools-extra/branches/release_80/clangd/Threading.cpp Wed Feb 27 06:58:48 2019
@@ -9,6 +9,8 @@
 #include <pthread.h>
 #elif defined(__APPLE__)
 #include <sys/resource.h>
+#elif defined (_WIN32)
+#include <Windows.h>
 #endif
 
 namespace clang {
@@ -129,6 +131,11 @@ void setCurrentThreadPriority(ThreadPrio
               Priority == ThreadPriority::Low && !AvoidThreadStarvation
                   ? PRIO_DARWIN_BG
                   : 0);
+#elif defined(_WIN32)
+  SetThreadPriority(GetCurrentThread(),
+                    Priority == ThreadPriority::Low && !AvoidThreadStarvation
+                        ? THREAD_MODE_BACKGROUND_BEGIN
+                        : THREAD_MODE_BACKGROUND_END);
 #endif
 }
 




More information about the llvm-branch-commits mailing list