Skip to content

Commit

Permalink
OS X :(
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Sep 25, 2022
1 parent e8b09f1 commit 95f249a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/regression/60-doublelocking/05-rec.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
#include<unistd.h>
#include <assert.h>

#ifdef __APPLE__
// OS X does not have PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
int main(int argc, char const *argv[])
{
return 0;
}
#else

int g;

pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;

#ifndef __APPLE__
pthread_mutex_t mut2 = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
#endif


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

#ifndef __APPLE__
pthread_mutex_lock(&mut2); //NOWARN
pthread_mutex_lock(&mut2); //NOWARN
pthread_mutex_unlock(&mut2);
pthread_mutex_unlock(&mut2);
#endif

return 0;
}
#endif

0 comments on commit 95f249a

Please sign in to comment.