On Wed, Apr 5, 2017 at 12:27 PM, Branko Čibej <br...@apache.org> wrote: > On 05.04.2017 12:19, Yann Ylavic wrote: >> On Tue, Apr 4, 2017 at 10:57 PM, Jim Jagielski <j...@jagunet.com> wrote: >>>> On Apr 4, 2017, at 4:29 PM, Yann Ylavic <ylavic....@gmail.com> wrote: >>>> >>>> >>>> I'm not a big fan of the "sleep" fallback implementation. >>>> >>> Feel free to replace it with something better. >> Would an implementation based on a pipe (hence two FDs per mutex) be >> acceptable? > > The default open-file limit on the Mac is a paltry 256, I'm not sure > it'd be a good idea for APR to suddenly start using up file descriptors > for timed waits on mutexes.
Yes, that was my fear... > > Couldn't we use a condition variable for this? We can for thread-mutexes (was the case before this commit), but not for proc-mutexes since OSX also lacks pshared condvars (i.e. PTHREAD_CONDATTR_SETPSHARED). > Spinning in sleep() is > less than efficient. Agreed, there seems to be few (if any) alternatives, though, but: avoid using apr_proc/global_mutex_timedlock() on OSX is recommended. Should we make it explicit with ENOTIMPL? Regards, Yann.