Skip to content

Commit 95f249a

Browse files
OS X :(
1 parent e8b09f1 commit 95f249a

File tree

1 file changed

+6
-8
lines changed
  • tests/regression/60-doublelocking

1 file changed

+6
-8
lines changed

tests/regression/60-doublelocking/05-rec.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@
55
#include<unistd.h>
66
#include <assert.h>
77

8-
#ifdef __APPLE__
9-
// OS X does not have PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
10-
int main(int argc, char const *argv[])
11-
{
12-
return 0;
13-
}
14-
#else
158

169
int g;
1710

1811
pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
12+
13+
#ifndef __APPLE__
1914
pthread_mutex_t mut2 = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
15+
#endif
16+
2017

2118
void* f1(void* ptr) {
2219
int top;
@@ -39,11 +36,12 @@ int main(int argc, char const *argv[])
3936
pthread_create(&t1,NULL,f1,NULL);
4037
pthread_join(t1, NULL);
4138

39+
#ifndef __APPLE__
4240
pthread_mutex_lock(&mut2); //NOWARN
4341
pthread_mutex_lock(&mut2); //NOWARN
4442
pthread_mutex_unlock(&mut2);
4543
pthread_mutex_unlock(&mut2);
44+
#endif
4645

4746
return 0;
4847
}
49-
#endif

0 commit comments

Comments
 (0)