summaryrefslogtreecommitdiff
path: root/test/tsan/libdispatch
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-04-05 02:05:57 +0000
committerJulian Lettner <jlettner@apple.com>2019-04-05 02:05:57 +0000
commit2d4b83275dd0ce04a117a78e1eaca45d189c24f9 (patch)
tree8ce21896695db8347f71dbb0efa16222b01f900b /test/tsan/libdispatch
parente24b1956459dd2a747d78110399464429027a21b (diff)
downloadcompiler-rt-2d4b83275dd0ce04a117a78e1eaca45d189c24f9.tar.gz
[TSan][libdispatch] Make test work on Linux, pt. 2
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@357741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan/libdispatch')
-rw-r--r--test/tsan/libdispatch/dispatch_once_deadlock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/tsan/libdispatch/dispatch_once_deadlock.c b/test/tsan/libdispatch/dispatch_once_deadlock.c
index 1e9e7d139..8379f81a9 100644
--- a/test/tsan/libdispatch/dispatch_once_deadlock.c
+++ b/test/tsan/libdispatch/dispatch_once_deadlock.c
@@ -28,8 +28,8 @@ int main() {
f();
- pthread_mutex_t mutex = {0};
- pthread_mutex_lock(&mutex);
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_unlock(&mutex); // Unlock of an unlocked mutex
fprintf(stderr, "g = %ld.\n", g);
fprintf(stderr, "h = %ld.\n", h);