Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
This commit is contained in:
21
vendor/spin/examples/debug.rs
vendored
Normal file
21
vendor/spin/examples/debug.rs
vendored
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