# Struct ocl::async::OrderLock [−] [src]

    pub struct OrderLock<V> { /* fields omitted */ }

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.

## Methods

### `impl<V> OrderLock<V>`
[src]

#### `pub fn new(data: V) -> OrderLock<V>`
[src]

Creates and returns a new `OrderLock`.

#### `pub fn read(self) -> FutureGuard<V, ReadGuard<V>>`
[src]

Returns a new `FutureGuard` which will resolve into a a `OrderGuard`.

#### `pub fn write(self) -> FutureGuard<V, WriteGuard<V>>`
[src]

Returns a new `FutureGuard` which will resolve into a a `OrderGuard`.

#### `pub fn as_ptr(&self) -> *const V`
[src]

Returns a reference to the inner value.

#### `pub fn as_mut_ptr(&self) -> *mut V`
[src]

Returns a mutable reference to the inner value.

## Trait Implementations

### `impl<V: Debug> Debug for OrderLock<V>`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl<V> From<QrwLock<V>> for OrderLock<V>`
[src]

#### `fn from(q: QrwLock<V>) -> OrderLock<V>`
[src]

Performs the conversion.

### `impl<V> From<V> for OrderLock<V>`
[src]

#### `fn from(vec: V) -> OrderLock<V>`
[src]

Performs the conversion.

### `impl<V> Clone for OrderLock<V>`
[src]

#### `fn clone(&self) -> OrderLock<V>`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl<T: OclPrm> From<OrderLock<Inner<T>>> for BufferSink<T>`
[src]

#### `fn from(order_lock: OrderLock<Inner<T>>) -> BufferSink<T>`
[src]

Performs the conversion.

### `impl<T: OclPrm> From<OrderLock<Inner<T>>> for BufferStream<T>`
[src]

#### `fn from(order_lock: OrderLock<Inner<T>>) -> BufferStream<T>`
[src]

Performs the conversion.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)