[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haiku-commits
Subject:    [haiku-commits] Re: haiku: hrev51184 - headers/posix
From:       waddlesplash <waddlesplash () gmail ! com>
Date:       2017-05-29 14:39:46
Message-ID: CAEesM74OFRZh=hMKR3Y54+gcnfz2tGas6mmpAHbL-PNqLnHYfw () mail ! gmail ! com
[Download RAW message or body]

On Mon, May 29, 2017 at 8:20 AM, Hamish Morrison <hamishm53@gmail.com> 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic