mirror of
https://github.com/Noratrieb/nuclear.git
synced 2026-01-14 07:45:01 +01:00
17 lines
287 B
Rust
17 lines
287 B
Rust
use std::{ptr, 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()),
|
|
}
|
|
}
|
|
}
|