1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
4 void *ThreadFunc(void *m
) {
5 AnnotateRWLockAcquired(__FILE__
, __LINE__
, m
, 1);
11 AnnotateRWLockAcquired(__FILE__
, __LINE__
, &m
, 1);
13 pthread_create(&th
, 0, ThreadFunc
, &m
);
18 // CHECK: WARNING: ThreadSanitizer: double lock of a mutex
19 // CHECK: #0 AnnotateRWLockAcquired
20 // CHECK: #1 ThreadFunc
21 // CHECK: Location is stack of main thread.
22 // CHECK: Mutex {{.*}} created at:
23 // CHECK: #0 AnnotateRWLockAcquired
25 // CHECK: SUMMARY: ThreadSanitizer: double lock of a mutex {{.*}}mutex_double_lock.cpp{{.*}}ThreadFunc