mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
add checking (r == 0)
This commit is contained in:
@@ -25,7 +25,7 @@ pub unsafe fn read(&self) {
|
||||
let r = libc::pthread_rwlock_rdlock(self.inner.get());
|
||||
if r == libc::EAGAIN {
|
||||
panic!("rwlock maximum reader count exceeded");
|
||||
} else if r == libc::EDEADLK || *self.write_locked.get() {
|
||||
} else if r == libc::EDEADLK || (r == 0 && *self.write_locked.get()) {
|
||||
if r == 0 {
|
||||
self.raw_unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user