This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE354765: [clangd] Add thread priority lowering for MacOS as
well (authored by kadircet, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D58492?vs=187908&id=188106#toc
Repository:
r
gribozavr accepted this revision.
gribozavr added a comment.
This revision is now accepted and ready to land.
I see, there's no SCHED_IDLE in the macOS SDK. OK then, I trust that people
who wrote CIndex.cpp support for macOS probably have got it correctly working
for macOS, so it makes sense to
kadircet updated this revision to Diff 187908.
kadircet marked an inline comment as done.
kadircet added a comment.
- Add required header
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58492/new/
https://reviews.llvm.org/D58492
Files:
clangd/Threa
kadircet marked an inline comment as done.
kadircet added inline comments.
Comment at: clangd/Threading.cpp:125
+#elif defined(__APPLE__)
+ //
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpriority.2.html
+ setpriority(PR
kadircet added a comment.
This one was used in a few different places in clang, for ex:
https://github.com/llvm-mirror/clang/blob/master/tools/libclang/CIndex.cpp#L8713.
Therefore I've used the same funcitonality.
Regarding `pthread_setschedparam` does setting prioirty to
`PTHREAD_MIN_PRIORITY
gribozavr added a comment.
macOS supports `pthread_setschedparam()` that we call on Linux, why not reuse
the same code path?
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/pthread_setschedparam.3.html
Repository:
rCTE Clang Tools Extra
CHA
ilya-biryukov added inline comments.
Comment at: clangd/Threading.cpp:125
+#elif defined(__APPLE__)
+ //
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpriority.2.html
+ setpriority(PRIO_DARWIN_THREAD, 0,
ilya-biryukov added a reviewer: gribozavr.
ilya-biryukov added a subscriber: gribozavr.
ilya-biryukov added a comment.
Not an expert on MacOS threading APIs, only checked this builds on Mac.
@gribozavr could you confirm using these APIs is the right thing to do on Mac?
Comment
kadircet created this revision.
kadircet added a reviewer: ilya-biryukov.
Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric.
Herald added a project: clang.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D58492
Files:
clangd/Threading.cpp
Index: clangd/T