TVar

Shared memory locations that support atomic memory transactions.
Shared memory locations that support atomic memory transactions.
Transactional variables, for use with MonadSTM. Deviations: There is no Eq instance for MonadSTM the TVar type. Furthermore, the newTVarIO and mkWeakTVar functions are not provided.
GVariant
Every TVar has a unique identifier.
TVar contents
Get the TVars affected by a ThreadAction.
Get the TVars a transaction read from.
Get the TVars a transaction wrote to (or would have, if it didn't retry).
A MutVar# behaves like a single-element mutable array.
Modify the contents of a MutVar#, returning the previous contents x :: a and the result of applying the given function to the previous contents f x :: c. The data type c (not a newtype!) must be a record whose first field is of lifted type a :: Type and is not unpacked. For example, product types c ~ Solo a or c ~ (a, b) work well. If the record type is both monomorphic and strict in its first field, it's recommended to mark the latter {-# NOUNPACK #-} explicitly. Under the hood atomicModifyMutVar2# atomically replaces a pointer to an old x :: a with a pointer to a selector thunk fst r, where fst is a selector for the first field of the record and r is a function application thunk r = f x. atomicModifyIORef2Native from atomic-modify-general package makes an effort to reflect restrictions on c faithfully, providing a well-typed high-level wrapper.
Modify the contents of a MutVar#, returning the previous contents and the result of applying the given function to the previous contents.
Create a new TVar holding a value supplied