fast_stm

Function retry

Source
pub fn retry<T>() -> StmResult<T>
Expand description

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 TVars 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());