IORefCAS-0.2.0.1: Atomic compare and swap for IORefs and STRefs.

Safe HaskellNone

Data.CAS.Internal.Fake

Description

This is an attempt to imitate a CAS using normal Haskell/GHC operations. Useful for debugging.

Synopsis

Documentation

data CASRef a Source

The type of references supporting CAS.

Instances

casIORef :: IORef a -> a -> a -> IO (Bool, a)Source

ptrEq :: a -> a -> BoolSource

atomicModifyIORefCAS :: IORef a -> (a -> (a, b)) -> IO bSource

atomicModifyIORefCAS_ :: IORef a -> (a -> a) -> IO ()Source