This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
error: 'PTHREAD_MUTEX_RECURSIVE' undeclared
- From: "Metuki Sabhe" <sabhe dot metuki at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 10 Mar 2008 21:16:27 +0200
- Subject: error: 'PTHREAD_MUTEX_RECURSIVE' undeclared
Hello,
I encounter the above-mentioned error when trying to do a simple
pthread_mutexattr_settype( &mutex_attr, PTHREAD_MUTEX_RECURSIVE);
(yes, <pthread.h> is included).
Any idea why ?
Reading pthread.h I have found out that PTHREAD_MUTEX_RECURSIVE is declared
only if some weird __USE_UNIX98 macro is defined.
and I don't want to define weird macros. But, I also saw that
PTHREAD_MUTEX_RECURSIVE
actually equals to a PTHREAD_MUTEX_RECURSIVE_NP macro. what is this macro ?
It is not mentioned in the man page. I tried it, it compiles, and the
code actually works
(I get the desired recursive behavior).
Can someone please shed some light here ?
Thank you very much,
Metuki