[lsb-discuss] Pthread mutex types incorrect

Simon White s_a_white at email.com
Tue Jan 15 02:18:18 PST 2008


Hi,

Apologies if this has already been found (I've only tested against 3.1). 
According to the main system headers (and those supplied by the lsb build
environment under /usr/include):

enum
{
PTHREAD_MUTEX_TIMED_NP,
PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK_NP,
PTHREAD_MUTEX_ADAPTIVE_NP
#ifdef __USE_UNIX98
,
PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
#endif

Therefore:

NORMAL = 0
RECURSIVE = 1
ERRORCHECK = 2
DEFAULT = 0

According to LSB headers:

#define PTHREAD_SCOPE_SYSTEM    0
#define PTHREAD_MUTEX_DEFAULT   1
#define PTHREAD_MUTEX_NORMAL    1
#define PTHREAD_SCOPE_PROCESS   1
#define PTHREAD_MUTEX_RECURSIVE 2
#define PTHREAD_RWLOCK_DEFAULT_NP       2
#define PTHREAD_MUTEX_ERRORCHECK        3

As a quick verification building a program for recusive mutexs works when
built against the system headers but fails with a dead lock error when
built against LSB and then installed and run on the system.

Regards,
Simon

-- 
Want an e-mail address like mine?
Get a free e-mail account today at www.mail.com!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux-foundation.org/pipermail/lsb-discuss/attachments/20080115/0ff7fc38/attachment.htm 


More information about the lsb-discuss mailing list