[haiku-commits] Re: haiku: hrev51184 - headers/posix
- From: waddlesplash <waddlesplash@xxxxxxxxx>
- To: haiku-commits@xxxxxxxxxxxxx
- Date: Mon, 29 May 2017 10:39:46 -0400
On Mon, May 29, 2017 at 8:20 AM, Hamish Morrison <hamishm53@xxxxxxxxx> wrote:
I'm afraid this won't work. pthread_rwlock_init creates semaphores and
constructs C++ objects:
http://cgit.haiku-os.org/haiku/tree/src/system/libroot/posix/pthread/pthread_rwlock.cpp#n105
This static initialiser leaves the semaphore in an unusable state.
Oops. Hmm, looking at other implementations, the thing to do is to
check if "sem" is null on the first call to pthread_rwlock_*() and
initialize then. Does that sound correct?
-waddlesplash
Other related posts: