digitalmars.D.bugs - [Issue 14617] New: PTHREAD_MUTEX_INITIALIZER does not work on OSX
- via Digitalmars-d-bugs (25/25) May 22 2015 https://issues.dlang.org/show_bug.cgi?id=14617
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: nobody puremagic.com Reporter: andrei erdani.com 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? --
May 22 2015