// (Windows locks are reentrant, and we have only 1 thread,
// so not doing any futher checks here is at least not incorrect.)
}
+ "TryEnterCriticalSection" if this.frame().instance.to_string().starts_with("std::sys::windows::")
+ => {
+ // There is only one thread, so this always succeeds and returns TRUE
+ this.write_scalar(Scalar::from_int(1, dest.layout.size), dest)?;
+ }
_ => throw_unsup_format!("can't call foreign function: {}", link_name),
}
#![feature(rustc_private)]
-use std::sync::{Mutex, RwLock, TryLockError};
+use std::sync::{Mutex, TryLockError};
extern crate libc;
#[cfg(not(target_os = "windows"))]
fn test_rwlock_stdlib() {
+ use std::sync::RwLock;
let rw = RwLock::new(0);
{
let _read_guard = rw.read().unwrap();