This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]