[compiler-rt] 501a078 - Revert "[TSan][libdispatch] Add interceptors for dispatch_async_and_wait()"
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 18 09:50:10 PDT 2020
Author: Arthur Eubanks
Date: 2020-08-18T09:49:05-07:00
New Revision: 501a078cbb4a79170fccf1346d772dae3d318057
URL: https://github.com/llvm/llvm-project/commit/501a078cbb4a79170fccf1346d772dae3d318057
DIFF: https://github.com/llvm/llvm-project/commit/501a078cbb4a79170fccf1346d772dae3d318057.diff
LOG: Revert "[TSan][libdispatch] Add interceptors for dispatch_async_and_wait()"
This reverts commit d137db80297f286f3a19eacc63d4a980646da437.
Breaks builds on older SDKs.
Added:
Modified:
compiler-rt/lib/tsan/rtl/tsan_interceptors_libdispatch.cpp
Removed:
compiler-rt/test/tsan/libdispatch/async_and_wait.c
################################################################################
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_libdispatch.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_libdispatch.cpp
index 292ea5fbb239..5dacd3256abc 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_libdispatch.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_libdispatch.cpp
@@ -219,9 +219,6 @@ static void invoke_and_release_block(void *param) {
DISPATCH_INTERCEPT(dispatch, false)
DISPATCH_INTERCEPT(dispatch_barrier, true)
-DISPATCH_INTERCEPT_SYNC_F(dispatch_async_and_wait_f, false)
-DISPATCH_INTERCEPT_SYNC_B(dispatch_async_and_wait, false)
-
DECLARE_REAL(void, dispatch_after_f, dispatch_time_t when,
dispatch_queue_t queue, void *context, dispatch_function_t work)
@@ -749,8 +746,6 @@ void InitializeLibdispatchInterceptors() {
INTERCEPT_FUNCTION(dispatch_barrier_async_f);
INTERCEPT_FUNCTION(dispatch_barrier_sync);
INTERCEPT_FUNCTION(dispatch_barrier_sync_f);
- INTERCEPT_FUNCTION(dispatch_async_and_wait);
- INTERCEPT_FUNCTION(dispatch_async_and_wait_f);
INTERCEPT_FUNCTION(dispatch_after);
INTERCEPT_FUNCTION(dispatch_after_f);
INTERCEPT_FUNCTION(dispatch_once);
diff --git a/compiler-rt/test/tsan/libdispatch/async_and_wait.c b/compiler-rt/test/tsan/libdispatch/async_and_wait.c
deleted file mode 100644
index 5e63c118aef5..000000000000
--- a/compiler-rt/test/tsan/libdispatch/async_and_wait.c
+++ /dev/null
@@ -1,31 +0,0 @@
-// RUN: %clang_tsan %s -o %t
-// RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
-
-#include "dispatch/dispatch.h"
-
-#include <stdio.h>
-
-long global;
-
-int main() {
- dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL);
- dispatch_semaphore_t s = dispatch_semaphore_create(0);
-
- // Force queue to context switch onto separate thread.
- dispatch_async(q, ^{
- dispatch_semaphore_wait(s, DISPATCH_TIME_FOREVER);
- });
- dispatch_semaphore_signal(s);
-
- global++;
- dispatch_async_and_wait(q, ^{
- // The queue continues to execute on separate thread. This would cause a
- // race if we had used `dispatch_async()` without the `_and_wait` part.
- global++;
- });
- global++;
-
- fprintf(stderr, "Done.\n");
-}
-
-// CHECK: Done.
More information about the llvm-commits
mailing list