Function or

Source
pub fn or<F, G, T>(f: F, g: G) -> Stm<T>
where F: FnOnce() -> Stm<T>, G: FnOnce() -> Stm<T>,
Expand description

The primary verbs to interact with STM transactions. Run the first function; if it returns a StmControl::Retry, run the second function; if that too returns StmControl::Retry then combine the values they have read, so that the overall retry will react to any change.

If they return StmControl::Failure then just return that result, since the transaction can be retried right now.