aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
diff options
context:
space:
mode:
authorJulian Lettner <julian.lettner@apple.com>2020-08-11 15:01:20 -0700
committerJulian Lettner <julian.lettner@apple.com>2020-08-14 09:39:57 -0700
commitd137db80297f286f3a19eacc63d4a980646da437 (patch)
tree11ecd07c0a80301c891acd9e10fe143b1fc88eba /llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
parent059cb8b3c9f004b0720e2b1168f2f9c9273ff0f7 (diff)
downloadllvm-d137db80297f286f3a19eacc63d4a980646da437.zip
llvm-d137db80297f286f3a19eacc63d4a980646da437.tar.gz
llvm-d137db80297f286f3a19eacc63d4a980646da437.tar.bz2
[TSan][libdispatch] Add interceptors for dispatch_async_and_wait()
Add interceptors for `dispatch_async_and_wait[_f]()` which was added in macOS 10.14. This pair of functions is similar to `dispatch_sync()`, but does not force a context switch of the queue onto the caller thread when the queue is active (and hence is more efficient). For TSan, we can apply the same semantics as for `dispatch_sync()`. From the header docs: > Differences with dispatch_sync() > > When the runtime has brought up a thread to invoke the asynchronous > workitems already submitted to the specified queue, that servicing > thread will also be used to execute synchronous work submitted to the > queue with dispatch_async_and_wait(). > > However, if the runtime has not brought up a thread to service the > specified queue (because it has no workitems enqueued, or only > synchronous workitems), then dispatch_async_and_wait() will invoke the > workitem on the calling thread, similar to the behaviour of functions > in the dispatch_sync family. Additional context: > The guidance is to use `dispatch_async_and_wait()` instead of > `dispatch_sync()` when it is necessary to mix async and sync calls on > the same queue. `dispatch_async_and_wait()` does not guarantee > execution on the caller thread which allows to reduce context switches > when the target queue is active. > https://gist.github.com/tclementdev/6af616354912b0347cdf6db159c37057 rdar://35757961 Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D85854
Diffstat (limited to 'llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp')
0 files changed, 0 insertions, 0 deletions