1 // RUN: %clangxx -O1 %s -o %t && %run %t
2 // RUN: %clangxx -O1 -DUSE_GLIBC %s -o %t && %run %t
3 // UNSUPPORTED: android
7 #if !defined(__GLIBC_PREREQ)
8 #define __GLIBC_PREREQ(a, b) 0
11 #if defined(USE_GLIBC) && !__GLIBC_PREREQ(2, 34)
12 // They were removed from GLIBC 2.34
13 extern "C" int __pthread_mutex_lock(pthread_mutex_t
*__mutex
);
14 extern "C" int __pthread_mutex_unlock(pthread_mutex_t
*__mutex
);
15 #define LOCK __pthread_mutex_lock
16 #define UNLOCK __pthread_mutex_unlock
18 #define LOCK pthread_mutex_lock
19 #define UNLOCK pthread_mutex_unlock
22 pthread_mutex_t m
= PTHREAD_MUTEX_INITIALIZER
;
25 static void *Start(void *arg
) {
33 pthread_t threads
[2] = {};
34 for (pthread_t
&t
: threads
)
35 pthread_create(&t
, 0, &Start
, 0);
36 for (pthread_t
&t
: threads
)