Safe Haskell | None |
---|
This module provides only the raw primops (and necessary types) for atomic operations.
- casArray# :: MutableArray# RealWorld a -> Int# -> Ticket a -> Ticket a -> State# RealWorld -> (#State# RealWorld, Int#, Ticket a#)
- casByteArrayInt# :: MutableByteArray# s -> Int# -> Int# -> Int# -> State# s -> (#State# s, Int##)
- fetchAddByteArrayInt# :: MutableByteArray# s -> Int# -> Int# -> State# s -> (#State# s, Int##)
- readForCAS# :: MutVar# RealWorld a -> State# RealWorld -> (#State# RealWorld, Ticket a#)
- casMutVarTicketed# :: MutVar# RealWorld a -> Ticket a -> Ticket a -> State# RealWorld -> (#State# RealWorld, Int#, Ticket a#)
- type Ticket a = Any a
- stg_storeLoadBarrier# :: State# RealWorld -> (#State# RealWorld, Int##)
- stg_loadLoadBarrier# :: State# RealWorld -> (#State# RealWorld, Int##)
- stg_writeBarrier# :: State# RealWorld -> (#State# RealWorld, Int##)
Documentation
casArray# :: MutableArray# RealWorld a -> Int# -> Ticket a -> Ticket a -> State# RealWorld -> (#State# RealWorld, Int#, Ticket a#)Source
Unsafe, machine-level atomic compare and swap on an element within an Array.
casByteArrayInt# :: MutableByteArray# s -> Int# -> Int# -> Int# -> State# s -> (#State# s, Int##)Source
fetchAddByteArrayInt# :: MutableByteArray# s -> Int# -> Int# -> State# s -> (#State# s, Int##)Source
casMutVarTicketed# :: MutVar# RealWorld a -> Ticket a -> Ticket a -> State# RealWorld -> (#State# RealWorld, Int#, Ticket a#)Source
When performing compare-and-swaps, the ticket encapsulates proof that a thread observed a specific previous value of a mutable variable. It is provided in lieu of the old value to compare-and-swap.
stg_storeLoadBarrier# :: State# RealWorld -> (#State# RealWorld, Int##)Source
stg_loadLoadBarrier# :: State# RealWorld -> (#State# RealWorld, Int##)Source
stg_writeBarrier# :: State# RealWorld -> (#State# RealWorld, Int##)Source