feat: add crossbeam_n_parking_lot

This commit is contained in:
2020-12-26 00:52:05 +08:00
parent 64ea4ba82e
commit 6843d69daf
3 changed files with 232 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
use crossbeam_channel::unbounded;
// use lock_api::Mutex;
// use std::sync::Arc;
use std::thread;
fn main() {
// let lock = Arc::new(Mutex::new::<RawSpinlock, i32>(0_i32));
let (s, r) = unbounded::<i32>();
thread::spawn(move || {
s.send(1).unwrap();
});
let x = r.recv().unwrap();
println!("Received: {}", x);
}