pub struct OrderLock<V> { /* private fields */ }
Expand description
A lock with conserved global order which interoperates with OpenCL events and Rust futures to provide exclusive access to data.
Calling ::read
or ::write
returns a future which will resolve into a
OrderGuard
.
§Platform Compatibility
Some CPU device/platform combinations have synchronization problems when
accessing an OrderLock
from multiple threads. Known platforms with problems
are 2nd and 4th gen Intel Core processors (Sandy Bridge and Haswell) with
Intel OpenCL CPU drivers. Others may be likewise affected. Run the
device_check.rs
example to determine if your device/platform is
affected. AMD platform drivers are known to work properly on the
aforementioned CPUs so use those instead if possible.
Implementations§
source§impl<V> OrderLock<V>
impl<V> OrderLock<V>
sourcepub fn read(self) -> FutureGuard<V, ReadGuard<V>>
pub fn read(self) -> FutureGuard<V, ReadGuard<V>>
Returns a new FutureGuard
which will resolve into a a OrderGuard
.
sourcepub fn write(self) -> FutureGuard<V, WriteGuard<V>>
pub fn write(self) -> FutureGuard<V, WriteGuard<V>>
Returns a new FutureGuard
which will resolve into a a OrderGuard
.
sourcepub fn as_mut_ptr(&self) -> *mut V
pub fn as_mut_ptr(&self) -> *mut V
Returns a mutable reference to the inner value.