From 7d1ec7b07ee1494659ecdc519c18e8c53cabe189 Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Fri, 5 Apr 2019 02:05:57 +0000 Subject: [PATCH] [TSan][libdispatch] Make test work on Linux, pt. 2 llvm-svn: 357741 --- compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c b/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c index 1e9e7d139f4c..8379f81a9101 100644 --- a/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c +++ b/compiler-rt/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);