Move some things to std::sync::poison and reexport them in std::sync

This commit is contained in:
Pavel Grigorenko 2024-12-23 19:36:41 +03:00
parent 41b579660c
commit ee2ad4dfb1
21 changed files with 141 additions and 37 deletions

View file

@ -1,7 +1,7 @@
use crate::cell::Cell;
use crate::sync as public;
use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
use crate::sync::once::ExclusiveState;
use crate::sync::poison::once::ExclusiveState;
use crate::sys::futex::{Futex, Primitive, futex_wait, futex_wake_all};
// On some platforms, the OS is very nice and handles the waiter queue for us.

View file

@ -1,6 +1,6 @@
use crate::cell::Cell;
use crate::sync as public;
use crate::sync::once::ExclusiveState;
use crate::sync::poison::once::ExclusiveState;
pub struct Once {
state: Cell<State>,

View file

@ -58,7 +58,7 @@
use crate::cell::Cell;
use crate::sync::atomic::Ordering::{AcqRel, Acquire, Release};
use crate::sync::atomic::{AtomicBool, AtomicPtr};
use crate::sync::once::ExclusiveState;
use crate::sync::poison::once::ExclusiveState;
use crate::thread::{self, Thread};
use crate::{fmt, ptr, sync as public};