mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
Update.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthrad_cond_t): Replace __unused field with __clock. * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before waken all waiters in cleanup handler. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
This commit is contained in:
parent
d5cb838958
commit
24a49f38ad
@ -1,5 +1,13 @@
|
|||||||
2003-03-18 Ulrich Drepper <drepper@redhat.com>
|
2003-03-18 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
|
||||||
|
(pthrad_cond_t): Replace __unused field with __clock.
|
||||||
|
|
||||||
|
* sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
|
||||||
|
waken all waiters in cleanup handler.
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
|
||||||
|
|
||||||
* pthread_condattr_getclock.c: New file.
|
* pthread_condattr_getclock.c: New file.
|
||||||
* pthread_condattr_setclock.c: New file.
|
* pthread_condattr_setclock.c: New file.
|
||||||
* sysdeps/pthread/pthread.h: Declare these new functions.
|
* sysdeps/pthread/pthread.h: Declare these new functions.
|
||||||
|
@ -50,6 +50,9 @@ __condvar_cleanup (void *arg)
|
|||||||
++cbuffer->cond->__data.__wakeup_seq;
|
++cbuffer->cond->__data.__wakeup_seq;
|
||||||
++cbuffer->cond->__data.__woken_seq;
|
++cbuffer->cond->__data.__woken_seq;
|
||||||
|
|
||||||
|
/* We are done. */
|
||||||
|
lll_mutex_unlock (cbuffer->cond->__data.__lock);
|
||||||
|
|
||||||
/* Wake everybody to make sure no condvar signal gets lost. */
|
/* Wake everybody to make sure no condvar signal gets lost. */
|
||||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
int *futex = ((int *) (&cbuffer->cond->__data.__wakeup_seq));
|
int *futex = ((int *) (&cbuffer->cond->__data.__wakeup_seq));
|
||||||
@ -60,9 +63,6 @@ __condvar_cleanup (void *arg)
|
|||||||
#endif
|
#endif
|
||||||
lll_futex_wake (futex, INT_MAX);
|
lll_futex_wake (futex, INT_MAX);
|
||||||
|
|
||||||
/* We are done. */
|
|
||||||
lll_mutex_unlock (cbuffer->cond->__data.__lock);
|
|
||||||
|
|
||||||
/* Get the mutex before returning unless asynchronous cancellation
|
/* Get the mutex before returning unless asynchronous cancellation
|
||||||
is in effect. */
|
is in effect. */
|
||||||
if (!(cbuffer->oldtype & CANCELTYPE_BITMASK))
|
if (!(cbuffer->oldtype & CANCELTYPE_BITMASK))
|
||||||
|
@ -70,12 +70,6 @@ __condvar_cleanup:
|
|||||||
addl $1, woken_seq-wakeup_seq(%ebx)
|
addl $1, woken_seq-wakeup_seq(%ebx)
|
||||||
adcl $0, woken_seq-wakeup_seq+4(%ebx)
|
adcl $0, woken_seq-wakeup_seq+4(%ebx)
|
||||||
|
|
||||||
/* Wake up all waiters to make sure no signal gets lost. */
|
|
||||||
movl $FUTEX_WAKE, %ecx
|
|
||||||
movl $SYS_futex, %eax
|
|
||||||
movl $0x7fffffff, %edx
|
|
||||||
ENTER_KERNEL
|
|
||||||
|
|
||||||
LOCK
|
LOCK
|
||||||
subl $1, cond_lock-wakeup_seq(%ebx)
|
subl $1, cond_lock-wakeup_seq(%ebx)
|
||||||
je 2f
|
je 2f
|
||||||
@ -83,8 +77,14 @@ __condvar_cleanup:
|
|||||||
leal cond_lock-wakeup_seq(%ebx), %eax
|
leal cond_lock-wakeup_seq(%ebx), %eax
|
||||||
call __lll_mutex_unlock_wake
|
call __lll_mutex_unlock_wake
|
||||||
|
|
||||||
|
/* Wake up all waiters to make sure no signal gets lost. */
|
||||||
|
2: movl $FUTEX_WAKE, %ecx
|
||||||
|
movl $SYS_futex, %eax
|
||||||
|
movl $0x7fffffff, %edx
|
||||||
|
ENTER_KERNEL
|
||||||
|
|
||||||
/* Lock the mutex unless asynchronous cancellation is in effect. */
|
/* Lock the mutex unless asynchronous cancellation is in effect. */
|
||||||
2: testl $2, (%esi)
|
testl $2, (%esi)
|
||||||
jne 3f
|
jne 3f
|
||||||
|
|
||||||
pushl 8(%esi)
|
pushl 8(%esi)
|
||||||
|
@ -74,7 +74,7 @@ typedef union
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int __lock;
|
int __lock;
|
||||||
int __unused;
|
int __clock;
|
||||||
unsigned long long int __total_seq;
|
unsigned long long int __total_seq;
|
||||||
unsigned long long int __wakeup_seq;
|
unsigned long long int __wakeup_seq;
|
||||||
unsigned long long int __woken_seq;
|
unsigned long long int __woken_seq;
|
||||||
|
@ -65,14 +65,6 @@ __condvar_cleanup:
|
|||||||
|
|
||||||
incq woken_seq(%rdi)
|
incq woken_seq(%rdi)
|
||||||
|
|
||||||
/* Wake up all waiters to make sure no signal gets lost. */
|
|
||||||
addq $wakeup_seq, %rdi
|
|
||||||
movq $FUTEX_WAKE, %rsi
|
|
||||||
movl $0x7fffffff, %edx
|
|
||||||
movq $SYS_futex, %rax
|
|
||||||
syscall
|
|
||||||
subq $wakeup_seq, %rdi
|
|
||||||
|
|
||||||
LOCK
|
LOCK
|
||||||
#if cond_lock == 0
|
#if cond_lock == 0
|
||||||
decl (%rdi)
|
decl (%rdi)
|
||||||
@ -85,8 +77,15 @@ __condvar_cleanup:
|
|||||||
#endif
|
#endif
|
||||||
callq __lll_mutex_unlock_wake
|
callq __lll_mutex_unlock_wake
|
||||||
|
|
||||||
|
/* Wake up all waiters to make sure no signal gets lost. */
|
||||||
|
2: addq $wakeup_seq, %rdi
|
||||||
|
movq $FUTEX_WAKE, %rsi
|
||||||
|
movl $0x7fffffff, %edx
|
||||||
|
movq $SYS_futex, %rax
|
||||||
|
syscall
|
||||||
|
|
||||||
/* Lock the mutex unless asynchronous cancellation is in effect. */
|
/* Lock the mutex unless asynchronous cancellation is in effect. */
|
||||||
2: testq $2, (%r8)
|
testq $2, (%r8)
|
||||||
jne 3f
|
jne 3f
|
||||||
|
|
||||||
movq 16(%r8), %rdi
|
movq 16(%r8), %rdi
|
||||||
|
Loading…
Reference in New Issue
Block a user