https://issues.dlang.org/show_bug.cgi?id=14617
Issue ID: 14617
Summary: PTHREAD_MUTEX_INITIALIZER does not work on OSX
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
Initializing a mutex with PTHREAD_MUTEX_INITIALIZER puts it in an all-zero
state:
pthread_mutex_t(0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
This state is unsuitable for calls such as pthread_mutex_lock etc. The state
after calling the dynamic initialization routine pthread_mutex_init is:
pthread_mutex_t(1297437784, [0, 0, 0, 0, 96, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
How do we define this state using the available pthread/OSX constants?
--