Struct hexodsp::dsp::SyncUnsafeCell
source · [−]pub struct SyncUnsafeCell<T: ?Sized> {
value: UnsafeCell<T>,
}
Fields
value: UnsafeCell<T>
Implementations
sourceimpl<T> SyncUnsafeCell<T>
impl<T> SyncUnsafeCell<T>
sourceimpl<T: ?Sized> SyncUnsafeCell<T>
impl<T: ?Sized> SyncUnsafeCell<T>
sourcepub unsafe fn get(&self) -> *mut T
pub unsafe fn get(&self) -> *mut T
Gets a pointer to a mutable memory cell that is marked being Sync.
Safety
This method is used together with std::sync::Arc in an usually unsafe way to directly get write access to something that is potentially unsafely shared across multiple threads.
In HexoDSP this is used for accessing DspNode state in the audio thread.
The architecture of HexoDSP makes sure, that the
Arc<SyncUnsafeCell<dyn DspNode>>
is only accessed from the audio thread
at a given time. Any UI or frontend thread is not going to access these
in crate::nodes::NodeConfigurator.
Trait Implementations
sourceimpl<T: Debug + ?Sized> Debug for SyncUnsafeCell<T>
impl<T: Debug + ?Sized> Debug for SyncUnsafeCell<T>
impl<T: ?Sized> Sync for SyncUnsafeCell<T>
Auto Trait Implementations
impl<T> !RefUnwindSafe for SyncUnsafeCell<T>
impl<T: ?Sized> Send for SyncUnsafeCell<T>where
T: Send,
impl<T: ?Sized> Unpin for SyncUnsafeCell<T>where
T: Unpin,
impl<T: ?Sized> UnwindSafe for SyncUnsafeCell<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more