Re: How to wait on a global lock with timeout

2015-05-16 Thread Micha Lenk
Hi Yann, thanks for your explanation. Am 16.05.2015 um 19:05 schrieb Yann Ylavic: Trying to get locked mutex... timed out after 1 second (expected) Child trying to unlock the mutex got 1 (unexpected) Trying to get locked mutex... timed out after 2 seconds (unexpected) Did I do anything

Re: How to wait on a global lock with timeout

2015-05-16 Thread Yann Ylavic
Hi Micha, On Sat, May 16, 2015 at 5:22 PM, Micha Lenk mi...@lenk.info wrote: Sorry, took me a while to give your patch a try. As the patch didn't apply cleanly to trunk (ie. SVN rev. 1676013), I assume that it is already applied in trunk. So I went ahead without applying your patch. Is this

Re: How to wait on a global lock with timeout

2015-05-16 Thread Micha Lenk
Hi Yann, Am 25.03.2015 um 09:56 schrieb Yann Ylavic: To mitigate that design flaw I would provide the timeout by reference and update it by the functions using it. This has also the nice benefit that the caller is able to retrieve the time it needed to wait. By doing so, you have to get the

Re: How to wait on a global lock with timeout

2015-03-25 Thread Micha Lenk
Hi Yann, Am 20.03.2015 um 02:59 schrieb Yann Ylavic: a few times later, commited in [1] and [2] :) Wow, thanks for coming back to that issue. Can you please check if it works for you? I only had time to review the code changes. I looked at the implementation of apr_global_mutex_timedlock().

Re: How to wait on a global lock with timeout

2015-03-25 Thread Yann Ylavic
Hi Micha, thanks for the review. On Wed, Mar 25, 2015 at 7:19 AM, Micha Lenk mi...@lenk.info wrote: I only had time to review the code changes. I looked at the implementation of apr_global_mutex_timedlock(). There I noticed that, if APR_HAS_THREADS, you are doing 3 timed operations without

Re: How to wait on a global lock with timeout

2015-03-19 Thread Yann Ylavic
Hi Micha, a few times later, commited in [1] and [2] :) Can you please check if it works for you? I also attached the patch against 1.6.x, if that can help... It should also apply to 1.5.x, though it will never be backported there (due to API changes). Thanks for your interest, Yann. [1]

Re: How to wait on a global lock with timeout

2014-09-30 Thread Yann Ylavic
Hi Micha, On Mon, Sep 29, 2014 at 3:18 PM, Micha Lenk mi...@lenk.info wrote: in an Apache module I am in the need to wait for a global lock (e.g. an apr_global_mutex_t), but in theory the lock might not get released by the other process in a timely manner, so I would like to limit the time to

Re: How to wait on a global lock with timeout

2014-09-30 Thread Yann Ylavic
On Tue, Sep 30, 2014 at 5:30 PM, Yann Ylavic ylavic@gmail.com wrote: I have been working on a patch to provide apr_[thread/proc]_mutex_timedlock() in APR, but did not finish the work mostly because of APR_ENOTIMPL on some mutex mechanisms (mainly Windows CRITICAL_SECTIONs which lack the

Re: How to wait on a global lock with timeout

2014-09-30 Thread Micha Lenk
Hi Yann, On 30.09.2014 18:16, Yann Ylavic wrote: On Tue, Sep 30, 2014 at 5:30 PM, Yann Ylavic ylavic@gmail.com wrote: I have been working on a patch to provide apr_[thread/proc]_mutex_timedlock() in APR, [...] I think that is exactly what I was looking for... Your idea to use the native

Re: How to wait on a global lock with timeout

2014-09-30 Thread Massimo Manghi
I join the line of those waiting for this feature in APR. I really would like to have it available -- Massimo Il 30/Set/2014 18:16 Yann Ylavic ylavic@gmail.com ha scritto: On Tue, Sep 30, 2014 at 5:30 PM, Yann Ylavic ylavic@gmail.com wrote: I have been working on a patch to provide