1
0
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:
2018-12-15 15:50:48 -05:00
parent a0f06ab30a
commit 816c4f994f
12 changed files with 1331 additions and 2 deletions

View 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);
}
}