Auto merge of #65228 - Wind-River:real_master, r=dtolnay

vxworks: add checking (r == 0)
This commit is contained in:
bors 2019-10-09 16:31:49 +00:00
commit 20cc752726

View File

@ -25,7 +25,7 @@ impl RWLock {
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();
}