Skip to content

Commit

Permalink
(__lll_robust_lock_wait): Also set FUTEX_WAITERS buit if we got the m…
Browse files Browse the repository at this point in the history
…utex. (__lll_robust_timedlock_wait): Likewise.
  • Loading branch information
Ulrich Drepper committed Mar 2, 2006
1 parent c99445f commit 42b6ddf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ __lll_robust_mutex_lock_wait:
jne 4b

movl %gs:TID, %edx
orl $FUTEX_WAITERS, %edx
LOCK
cmpxchgl %edx, (%ebx)
jnz 4b
Expand Down Expand Up @@ -163,6 +164,7 @@ __lll_robust_mutex_timedlock_wait:
jne 7f

movl %gs:TID, %edx
orl $FUTEX_WAITERS, %edx
LOCK
cmpxchgl %edx, (%ebx)
jnz 7f
Expand Down
6 changes: 4 additions & 2 deletions nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ __lll_robust_lock_wait (int *futex)

lll_futex_wait (futex, newval);
}
while ((oldval = atomic_compare_and_exchange_val_acq (futex, tid, 0)) != 0);
while ((oldval = atomic_compare_and_exchange_val_acq (futex,
tid | FUTEX_WAITERS,
0)) != 0);
return 0;
}

Expand Down Expand Up @@ -89,7 +91,7 @@ __lll_robust_timedlock_wait (int *futex, const struct timespec *abstime)

lll_futex_timed_wait (futex, newval, &rt);
}
while (atomic_compare_and_exchange_bool_acq (futex, tid, 0));
while (atomic_compare_and_exchange_bool_acq (futex, tid | FUTEX_WAITERS, 0));

return 0;
}

0 comments on commit 42b6ddf

Please sign in to comment.