mirror of
https://github.com/Noratrieb/nuclear.git
synced 2026-01-14 15:55:02 +01:00
mutex
This commit is contained in:
parent
2d3b5f3c94
commit
25ac075ef1
3 changed files with 75 additions and 1 deletions
18
src/linked_list.rs
Normal file
18
src/linked_list.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use std::ptr;
|
||||
use std::sync::atomic::AtomicPtr;
|
||||
|
||||
pub struct LinkedList<T> {
|
||||
head: AtomicPtr<Node<T>>,
|
||||
}
|
||||
|
||||
struct Node<T> {
|
||||
next: AtomicPtr<Node<T>>,
|
||||
}
|
||||
|
||||
impl<T> LinkedList<T> {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
head: AtomicPtr::new(ptr::null_mut()),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue