This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [BZ 5240][PATCH] Pthread hang where there are still waiters when mutex is in "unlocked" state.
On Fri, 2007-11-23 at 20:43 -0800, Ulrich Drepper wrote:
> Try the current cvs code.
I did:
> This is true for the old implementation of __lll_timedlock_wait and
> the current one.
After a thread got back control after lll_futex_timed_wait in
__lll_timedlock_wait there are three possible lock values:
0: the lock is free, compare-and-exchange of 2 vs 0 will succeed. The
unlock following the __lll_timedlock_wait will do the futex_wake.
1: the lock is not free, __lll_timedlock_wait will return with
ETIMEDOUT. The current lock holder will NOT do a futex_wake. The
current thread is the only one with the knowledge that there might
be other threads still waiting on a futex call.
2: the current lock holder will do a futex_wake when the lock is
released.
I do not see that case 1) is handled in the old and in the current code.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.