Skip to content

Conversation

@rofl0r
Copy link

@rofl0r rofl0r commented Sep 9, 2018

musl libc doesn't support PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP.
the _NP at the end means "non portable". that means it shouldn't be used.

instead the portable way is

pthread_mutex_t Mutex;
pthread_mutexattr_t Attr;

pthread_mutexattr_init(&Attr);
pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&Mutex, &Attr);

according to https://stackoverflow.com/questions/7037481/c-how-do-you-declare-a-recursive-mutex-with-posix-threads

i'm usign a bogus PR to report this issue, since "issues" are not available in this repo.

@rofl0r
Copy link
Author

rofl0r commented Sep 9, 2018

forgot the error msg

boden/wege/../../utils/simthread.h:27:48: error: 'PTHREAD_RECURSIVE_MUTEX_INITI$
 #define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIAL$
                                                ^
boden/wege/../../utils/simthread.h:27:48: note: in definition of macro 'PTHREAD$
 #define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIAL$

ceeac pushed a commit to ceeac/simutrans that referenced this pull request Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant