May 22, 2015 [Issue 14617] New: PTHREAD_MUTEX_INITIALIZER does not work on OSX | ||||
---|---|---|---|---|
| ||||
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? -- |
Copyright © 1999-2021 by the D Language Foundation