Adjust mutex lock in condvar_cleanup if we got it from requeue_pi

This completes the fix to bz #14652.
This commit is contained in:
Siddhesh Poyarekar 2012-10-16 14:23:01 +05:30
parent 172a631a1f
commit 9485a40444
5 changed files with 30 additions and 4 deletions

View File

@ -1,3 +1,16 @@
2012-10-16 Siddhesh Poyarekar <siddhesh@redhat.com>
[BZ #14652]
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
(__condvar_tw_cleanup): Adjust the mutex data structure if it
was locked by FUTEX_WAIT_REQUEUE_PI.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait
(__condvar_w_cleanup): Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
(__condvar_cleanup2): Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
(__condvar_cleanup1): Likewise.
2012-10-10 Carlos O'Donell <carlos@systemhalted.org>
* sysdeps/pthread/pthread.h [!(defined __GNUC__ &&

View File

@ -662,7 +662,10 @@ __condvar_tw_cleanup:
movl (%eax), %ebx
andl $TID_MASK, %ebx
cmpl %ebx, %gs:TID
je 9f
jne 8f
/* We managed to get the lock. Fix it up before returning. */
call __pthread_mutex_cond_lock_adjust
jmp 9f
8: call __pthread_mutex_cond_lock

View File

@ -579,7 +579,10 @@ __condvar_w_cleanup:
movl (%eax), %ebx
andl $TID_MASK, %ebx
cmpl %ebx, %gs:TID
je 9f
jne 8f
/* We managed to get the lock. Fix it up before returning. */
call __pthread_mutex_cond_lock_adjust
jmp 9f
8: call __pthread_mutex_cond_lock

View File

@ -784,7 +784,10 @@ __condvar_cleanup2:
movl (%rdi), %eax
andl $TID_MASK, %eax
cmpl %eax, %fs:TID
je 8f
jne 7f
/* We managed to get the lock. Fix it up before returning. */
callq __pthread_mutex_cond_lock_adjust
jmp 8f
7: callq __pthread_mutex_cond_lock

View File

@ -508,7 +508,11 @@ __condvar_cleanup1:
movl (%rdi), %eax
andl $TID_MASK, %eax
cmpl %eax, %fs:TID
je 8f
jne 7f
/* We managed to get the lock. Fix it up before returning. */
callq __pthread_mutex_cond_lock_adjust
jmp 8f
7: callq __pthread_mutex_cond_lock