Crate async_stm

Source

Modules§

auxtx
Auxiliary transactions.
queues
Transactional queue implementations.

Macros§

test_queue_mod
Reuse the same test definitions for each implementation of the TQueueLike trait by calling this macro with a function to create a new instance of the queue.

Structs§

TVar
TVar is the public interface to lift data into the transactional context for subsequent read and write operations. TVar is our handle to a variable, but reading and writing go through a transaction. It also tracks which threads are waiting on it.

Enums§

StmControl
Transaction shortcutting signals handled by the STM framework.
StmError
STM error extended with the ability to abort the transaction with an error. It is separate so that we rest assured that atomically will not return an error, that only atomically_or_err allows abortions.

Functions§

abort
The primary verbs to interact with STM transactions. Abort the transaction with an error.
atomically
The primary verbs to interact with STM transactions. Create a new transaction and run f until it returns a successful result and can be committed without running into version conflicts.
atomically_aux
The primary verbs to interact with STM transactions. Like atomically, but this version also takes an auxiliary transaction system that gets committed or rolled back together with the STM transaction.
atomically_or_err
The primary verbs to interact with STM transactions. Create a new transaction and run f until it returns a successful result and can be committed without running into version conflicts, or until it returns an StmError::Abort in which case the contained error is returned.
atomically_or_err_aux
The primary verbs to interact with STM transactions. Like atomically_or_err, but this version also takes an auxiliary transaction system.
guard
The primary verbs to interact with STM transactions. Retry unless a given condition has been met.
or
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.
retry
The primary verbs to interact with STM transactions. Abandon the transaction and retry after some of the variables read have changed.

Type Aliases§

Stm
Type returned by STM methods that cannot be aborted, the only reason they can fail is to be retried.
StmResult
Type returned by STM methods that can be aborted with an error.