[TSan][libdispatch] Add interceptors for dispatch_barrier_async_and_wait()
authorJulian Lettner <julian.lettner@apple.com>
Mon, 24 Aug 2020 20:56:22 +0000 (13:56 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Mon, 24 Aug 2020 21:01:04 +0000 (14:01 -0700)
Add interceptors for the barrier variants of the "async and wait"
dispatch API family.

compiler-rt/lib/tsan/rtl/tsan_interceptors_libdispatch.cpp

index 99ec275..2556de8 100644 (file)
@@ -235,9 +235,15 @@ SANITIZER_WEAK_IMPORT void dispatch_async_and_wait(
     dispatch_queue_t queue, DISPATCH_NOESCAPE dispatch_block_t block);
 SANITIZER_WEAK_IMPORT void dispatch_async_and_wait_f(
     dispatch_queue_t queue, void *context, dispatch_function_t work);
+SANITIZER_WEAK_IMPORT void dispatch_barrier_async_and_wait(
+    dispatch_queue_t queue, DISPATCH_NOESCAPE dispatch_block_t block);
+SANITIZER_WEAK_IMPORT void dispatch_barrier_async_and_wait_f(
+    dispatch_queue_t queue, void *context, dispatch_function_t work);
 
 DISPATCH_INTERCEPT_SYNC_B(dispatch_async_and_wait, false)
 DISPATCH_INTERCEPT_SYNC_F(dispatch_async_and_wait_f, false)
+DISPATCH_INTERCEPT_SYNC_B(dispatch_barrier_async_and_wait, true)
+DISPATCH_INTERCEPT_SYNC_F(dispatch_barrier_async_and_wait_f, true)
 #endif