diff options
Diffstat (limited to 'sysdeps/generic/pt-rwlock-unlock.c')
-rw-r--r-- | sysdeps/generic/pt-rwlock-unlock.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sysdeps/generic/pt-rwlock-unlock.c b/sysdeps/generic/pt-rwlock-unlock.c index fb23a0b..212cca5 100644 --- a/sysdeps/generic/pt-rwlock-unlock.c +++ b/sysdeps/generic/pt-rwlock-unlock.c @@ -65,19 +65,16 @@ pthread_rwlock_unlock (pthread_rwlock_t *rwlock) if (rwlock->readerqueue) { - __pthread_queue_iterate (rwlock->readerqueue, wakeup) - rwlock->readers ++; + __pthread_dequeuing_iterate (rwlock->readerqueue, wakeup) + { + rwlock->readers ++; + __pthread_wakeup (wakeup); + } - wakeup = rwlock->readerqueue; rwlock->readerqueue = 0; __pthread_spin_unlock (&rwlock->__lock); - /* We can safely walk the list of waiting threads without holding - the lock since it is now decoupled from the rwlock. */ - __pthread_dequeuing_iterate (wakeup, wakeup) - __pthread_wakeup (wakeup); - return 0; } |