mirror of
https://github.com/bspeice/qadapt
synced 2025-08-27 17:55:09 -04:00
Vendor in the spin crate for the time being
This commit is contained in:
21
qadapt-spin/examples/debug.rs
Normal file
21
qadapt-spin/examples/debug.rs
Normal file
@ -0,0 +1,21 @@
|
||||
extern crate spin;
|
||||
|
||||
fn main() {
|
||||
let mutex = spin::Mutex::new(42);
|
||||
println!("{:?}", mutex);
|
||||
{
|
||||
let x = mutex.lock();
|
||||
println!("{:?}, {:?}", mutex, *x);
|
||||
}
|
||||
|
||||
let rwlock = spin::RwLock::new(42);
|
||||
println!("{:?}", rwlock);
|
||||
{
|
||||
let x = rwlock.read();
|
||||
println!("{:?}, {:?}", rwlock, *x);
|
||||
}
|
||||
{
|
||||
let x = rwlock.write();
|
||||
println!("{:?}, {:?}", rwlock, *x);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user