Skip to content

Commit

Permalink
add checking (r == 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpangWR authored and BaoshanPang committed Oct 9, 2019
1 parent 46bf6ad commit 175db95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/sys/vxworks/rwlock.rs
Expand Up @@ -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();
}
Expand Down

0 comments on commit 175db95

Please sign in to comment.