about summary refs log tree commit diff
path: root/nptl/pthread_rwlock_unlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_rwlock_unlock.c')
-rw-r--r--nptl/pthread_rwlock_unlock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c
index b8336f62bf..d2ad4b0375 100644
--- a/nptl/pthread_rwlock_unlock.c
+++ b/nptl/pthread_rwlock_unlock.c
@@ -40,8 +40,13 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
     rwlock->__data.__writer = 0;
   else
     --rwlock->__data.__nr_readers;
+  /* If there are still readers present, we do not yet need to wake writers
+     nor are responsible to wake any readers.  */
   if (rwlock->__data.__nr_readers == 0)
     {
+      /* Note that if there is a blocked writer, we effectively make it
+	 responsible for waking any readers because we don't wake readers in
+	 this case.  */
       if (rwlock->__data.__nr_writers_queued)
 	{
 	  ++rwlock->__data.__writer_wakeup;