//! method, and see the method for more information about it. Due to this
//! caveat, this queue may not be appropriate for all use-cases.
-#![experimental]
+#![unstable]
// http://www.1024cores.net/home/lock-free-algorithms
// /queues/non-intrusive-mpsc-node-based-queue
use alloc::boxed::Box;
use core::mem;
+use core::ptr;
use core::cell::UnsafeCell;
use sync::atomic::{AtomicPtr, Ordering};
impl<T> Node<T> {
unsafe fn new(v: Option<T>) -> *mut Node<T> {
mem::transmute(box Node {
- next: AtomicPtr::new(0 as *mut Node<T>),
+ next: AtomicPtr::new(ptr::null_mut()),
value: v,
})
}
}
#[unsafe_destructor]
+#[stable]
impl<T: Send> Drop for Queue<T> {
fn drop(&mut self) {
unsafe {
q.push(i);
}
tx.send(()).unwrap();
- }).detach();
+ });
}
let mut i = 0u;