A container with an atomic take operation.
Create a new
AtomicTake with the given value.
Create an empty
AtomicTake that contains no value.
Takes out the value from this
AtomicTake. It is guaranteed that exactly one
caller will receive the value and all others will receive
This methods does the same as
take, but does not use an atomic swap.
This is safe because you cannot call this method without unique access to the
AtomicTake, so no other threads will try to take it concurrently.
Check whether the value is taken. Note that if this returns
false, then this
is immediately stale if another thread could be concurrently trying to take it.
Insert a new value into the
AtomicTake and return the previous value.
This function requires unique access to ensure no other threads accesses the
AtomicTake concurrently, as this operation cannot be performed atomically
without a lock.
impl<T> Debug for AtomicTake<T>[src]
impl<T> Drop for AtomicTake<T>[src]
impl<T> From<T> for AtomicTake<T>[src]
impl<T: Send> Sync for AtomicTake<T>[src]
type Error = !
The type returned in the event of a conversion error.