[haiku-commits] Re: r33543 - in haiku/trunk: headers/private/shared src/system/libroot/os

> mmlr@xxxxxxxx wrote:
> > Everything's currently exposed in shared/private/locks.h but I
> > think we should make these locking primitves public.
> 
> Why exactly would that be needed (besides convenience when sharing 
> kernel/userland code)? There is already the pthreads API which 
> provides 
> similar functionality, too.

No reason besides that I find the API quite to the point for what it 
does, so I didn't feel like changing it.

It's just that I see benaphores implemented over and over again, so 
providing a generic mutex would make sense IMO. I know that pthread 
provides these parts as well, but since it is POSIX it also has POSIX 
semantics like the return codes it uses for example. Providing some 
sort of "native" low level locking primitives besides sems just seems 
sensible to me. We are so focused on being multi-threaded that I find 
it a bit strange to not provide a set of adequate primitives to 
efficiently synchronize them.

Regards
Michael

Other related posts: