You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On linux pthread_rwlock_rdlock/wrlock return EDEADLK if you attempt to take the other type of lock when you own one. libstd ignores this when debug-assertions are not on, and then will try to unlock twice anyway. This leads to arbitrarily bad behavior (on playpen it happens to hit x86-HLE code and SIGILL):
use std::sync::RwLock;
fn main() {
let x = RwLock::new("");
let _w = x.write().unwrap();
let _r = x.read().unwrap();
}