Function stm_core::retry
[−]
[src]
pub fn retry<T>() -> StmResult<T>
Call retry
to abort an operation and run the whole transaction again.
Semantically retry
allows spin-lock-like behavior, but the library
blocks until one of the used TVar
s has changed, to keep CPU-usage low.
Transaction::or
allows to define alternatives. If the first function
wants to retry, then the second one has a chance to run.
Examples
let infinite_retry: i32 = atomically(|_| retry());