mirror of git://sourceware.org/git/glibc.git
Update.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Release lock before waking up the waiters.
This commit is contained in:
parent
427f5fa1a4
commit
567fb22ae3
|
|
@ -1,5 +1,8 @@
|
||||||
2003-02-27 Ulrich Drepper <drepper@redhat.com>
|
2003-02-27 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
|
||||||
|
Release lock before waking up the waiters.
|
||||||
|
|
||||||
* tst-exit1.c (do_test): Don't start more than one thread in parallel.
|
* tst-exit1.c (do_test): Don't start more than one thread in parallel.
|
||||||
|
|
||||||
* tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
|
* tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,24 @@ __pthread_cond_broadcast:
|
||||||
3: movl %ecx, (%ebx)
|
3: movl %ecx, (%ebx)
|
||||||
movl %eax, 4(%ebx)
|
movl %eax, 4(%ebx)
|
||||||
|
|
||||||
|
/* Unlock. */
|
||||||
|
LOCK
|
||||||
|
decl cond_lock-wakeup_seq(%ebx)
|
||||||
|
jne 7f
|
||||||
|
|
||||||
/* Wake up all threads. */
|
/* Wake up all threads. */
|
||||||
movl $FUTEX_WAKE, %ecx
|
8: movl $FUTEX_WAKE, %ecx
|
||||||
xorl %esi, %esi
|
xorl %esi, %esi
|
||||||
movl $SYS_futex, %eax
|
movl $SYS_futex, %eax
|
||||||
movl $0x7fffffff, %edx
|
movl $0x7fffffff, %edx
|
||||||
ENTER_KERNEL
|
ENTER_KERNEL
|
||||||
|
|
||||||
|
xorl %eax, %eax
|
||||||
|
popl %ebx
|
||||||
|
popl %esi
|
||||||
|
ret
|
||||||
|
|
||||||
|
.align 16
|
||||||
/* Unlock. */
|
/* Unlock. */
|
||||||
4: LOCK
|
4: LOCK
|
||||||
decl cond_lock-wakeup_seq(%ebx)
|
decl cond_lock-wakeup_seq(%ebx)
|
||||||
|
|
@ -98,10 +109,14 @@ __pthread_cond_broadcast:
|
||||||
jmp 2b
|
jmp 2b
|
||||||
|
|
||||||
/* Unlock in loop requires waekup. */
|
/* Unlock in loop requires waekup. */
|
||||||
5:
|
5: leal cond_lock-wakeup_seq(%ebx), %eax
|
||||||
leal cond_lock-wakeup_seq(%ebx), %eax
|
|
||||||
call __lll_mutex_unlock_wake
|
call __lll_mutex_unlock_wake
|
||||||
jmp 6b
|
jmp 6b
|
||||||
|
|
||||||
|
/* Unlock in loop requires waekup. */
|
||||||
|
7: leal cond_lock-wakeup_seq(%ebx), %eax
|
||||||
|
call __lll_mutex_unlock_wake
|
||||||
|
jmp 8b
|
||||||
.size __pthread_cond_broadcast, .-__pthread_cond_broadcast
|
.size __pthread_cond_broadcast, .-__pthread_cond_broadcast
|
||||||
versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
|
versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
|
||||||
GLIBC_2_3_2)
|
GLIBC_2_3_2)
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define N 20
|
|
||||||
|
|
||||||
static pthread_barrier_t b;
|
static pthread_barrier_t b;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -46,7 +44,7 @@ tf (void *arg)
|
||||||
static int
|
static int
|
||||||
do_test (void)
|
do_test (void)
|
||||||
{
|
{
|
||||||
if (pthread_barrier_init (&b, NULL, N + 1) != 0)
|
if (pthread_barrier_init (&b, NULL, 2) != 0)
|
||||||
{
|
{
|
||||||
puts ("barrier_init failed");
|
puts ("barrier_init failed");
|
||||||
exit (1);
|
exit (1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue