On 18/06/2017 11:34, Vivek Roy wrote:
That one implements a normal mutex, FreeBSD's sx is short for
shared/exclusive-lock, another name for a read/write-lock. According
to [0] they have a few specialties regarding their scheduling. You
could try and implement them using the Haiku kernel's rw_lock (see
headers/private/shared/locks.h), although it might be necessary to
take a close look at differences in behaviour. Also, our rw_lock
doesn't implement all the functions of FreeBSD's sx, such as
try-to-lock, so it needs to be seen of those are being used in the
code you're compiling.
[0] https://www.freebsd.org/cgi/man.cgi?query=sx_slock&sektion=9
<https://www.freebsd.org/cgi/man.cgi?query=sx_slock&sektion=9>
Okay, trying to implement sx.
Thanks