[m-rev.] for post-commit review: isolate all dependencies on POSIX unnamed semaphores
Paul Bone
paul at bone.id.au
Thu Sep 29 14:16:25 AEST 2016
On Thu, Sep 29, 2016 at 02:00:02PM +1000, Julien Fischer wrote:
>
> For post-commit review by Paul or Peter.
>
> ------------------------------------
>
> Isolate all dependencies on POSIX unnamed semaphores.
>
> Isolate all dependencies on POSIX unnamed semaphores to the runtime's
> mercury_thread module. This is a step towards fixing bug #357.
>
> runtime/mercury_thread.{h,c}:
> Provide wrappers for the functions sem_destroy and sem_timedwait.
> The latter does not exist on OS X, so (for now) just abort if it
> is called.
I was a little confused while reading the diff. There are actually two
wrappers for sem_timedwait, the C function and the macro. But only one
wrapper for the other calls. Making this clearer in the log message would
have made reading the diff slightly less confusing.
>
> runtime/mercury_context.c:
> library/thread.m:
> Use the above wrappers instead of calling the sem_* functions
> directly.
>
The change itself is fine.
I also commented on this issue in the bug tracker. The most important
details is probably that I remember choosing semaphores for this code in
particular for very specific reasons, I just don't remember exactly what
those reasons are.
--
Paul Bone
http://paul.bone.id.au
More information about the reviews
mailing list