зеркало из https://github.com/mozilla/pjs.git
Checked in an equivalent but simpler fix for Bug 165639
(NSSRWLock_UnlockWrite failed to wake up waiting readers).
This commit is contained in:
Родитель
4fbb23c2d0
Коммит
bde3b0335b
|
@ -331,18 +331,13 @@ NSSRWLock_UnlockWrite(NSSRWLock *rwlock)
|
||||||
|
|
||||||
rwlock->rw_owner = NULL; /* I don't own it any more. */
|
rwlock->rw_owner = NULL; /* I don't own it any more. */
|
||||||
|
|
||||||
if (rwlock->rw_reader_locks == 0) { /* no readers, wake up somebody. */
|
/* Give preference to waiting writers. */
|
||||||
/* Give preference to waiting writers. */
|
if (rwlock->rw_waiting_writers > 0) {
|
||||||
if (rwlock->rw_waiting_writers > 0)
|
if (rwlock->rw_reader_locks == 0)
|
||||||
PZ_NotifyCondVar(rwlock->rw_writer_waitq);
|
PZ_NotifyCondVar(rwlock->rw_writer_waitq);
|
||||||
else if (rwlock->rw_waiting_readers > 0)
|
} else if (rwlock->rw_waiting_readers > 0) {
|
||||||
PZ_NotifyAllCondVar(rwlock->rw_reader_waitq);
|
PZ_NotifyAllCondVar(rwlock->rw_reader_waitq);
|
||||||
} else {
|
}
|
||||||
/* Give preference to waiting writers. */
|
|
||||||
if ( rwlock->rw_waiting_writers == 0 &&
|
|
||||||
rwlock->rw_waiting_readers > 0)
|
|
||||||
PZ_NotifyAllCondVar(rwlock->rw_reader_waitq);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
PZ_Unlock(rwlock->rw_lock);
|
PZ_Unlock(rwlock->rw_lock);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче