[m-rev.] for post-commit review: isolate all dependencies on POSIX unnamed semaphores

Julien Fischer jfischer at opturion.com
Thu Sep 29 14:27:51 AEST 2016


On Thu, 29 Sep 2016, Peter Wang wrote:

> On Thu, 29 Sep 2016 14:00:02 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
>> +#if defined(MR_MAC_OSX)
>> +    #define MR_SEM_TIMED_WAIT(sem, abstime, from)                       \
>> +        ( MR_debug_threads ?                                            \
>> +            MR_sem_timed_wait((sem), (abstime), (from))                 \
>> +        :                                                               \
>> +            MR_fatal_error("sem_timedwait not supported on Mac OS X")   \
>> +        )
>> +#else
>> +    #define MR_SEM_TIMED_WAIT(sem, abstime, from)                       \
>> +        ( MR_debug_threads ?                                            \
>> +            MR_sem_timed_wait((sem), (abstime), (from))                 \
>> +        :                                                               \
>> +            sem_timedwait((sem))                                        \
>> +        )
>> +#endif
>
> Looks fine.  It's no big deal but IMHO we should have stuck to the
> pthreads naming.
>
> I see that we already have MR_WAIT, MR_TIMED_WAIT (with the underscore).
> It might be worth renaming them to MR_COND_WAIT, MR_COND_TIMEDWAIT to
> disambiguate them from the semaphore operations, and then do
> MR_COND_SIGNAL and MR_COND_BROADCAST as well.

Ok, I'll do that.

Julien.


More information about the reviews mailing list