pub struct SyncUnsafeCell<T: ?Sized> { /* private fields */ }Implementations§
Source§impl<T> SyncUnsafeCell<T>
impl<T> SyncUnsafeCell<T>
Source§impl<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§
impl<T: ?Sized> Sync for SyncUnsafeCell<T>
Auto Trait Implementations§
impl<T> !Freeze for SyncUnsafeCell<T>
impl<T> !RefUnwindSafe for SyncUnsafeCell<T>
impl<T> Send for SyncUnsafeCell<T>
impl<T> Unpin for SyncUnsafeCell<T>
impl<T> UnwindSafe for SyncUnsafeCell<T>where
T: UnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more