aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/pthread/pthread_cond_wait.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/pthread/pthread_cond_wait.c')
-rw-r--r--nptl/sysdeps/pthread/pthread_cond_wait.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nptl/sysdeps/pthread/pthread_cond_wait.c b/nptl/sysdeps/pthread/pthread_cond_wait.c
index f641a7e8b1..f5f5cec5a8 100644
--- a/nptl/sysdeps/pthread/pthread_cond_wait.c
+++ b/nptl/sysdeps/pthread/pthread_cond_wait.c
@@ -51,13 +51,15 @@ __condvar_cleanup (void *arg)
{
/* This thread is not waiting anymore. Adjust the sequence counters
appropriately. We do not increment WAKEUP_SEQ if this would
- bump it over the value of TOTAL_SEQ> This can happen if a thread
+ bump it over the value of TOTAL_SEQ. This can happen if a thread
was woken and then canceled. */
if (cbuffer->cond->__data.__wakeup_seq
< cbuffer->cond->__data.__total_seq)
- ++cbuffer->cond->__data.__wakeup_seq;
+ {
+ ++cbuffer->cond->__data.__wakeup_seq;
+ ++cbuffer->cond->__data.__futex;
+ }
++cbuffer->cond->__data.__woken_seq;
- ++cbuffer->cond->__data.__futex;
}
cbuffer->cond->__data.__nwaiters -= 1 << COND_CLOCK_BITS;