shared-buffer-0.2.2: A circular buffer built on shared memory
System.Posix.AtomicOps
Contents
Synopsis
data FPRef a Source
A reference to a value held in a Foreign Ptr
newFPRef :: Storable a => a -> IO (FPRef a) Source
readFPRef :: Storable a => FPRef a -> IO a Source
writeFPRef :: Storable a => FPRef a -> a -> IO () Source
fetchAddFPRef :: FPRef Int -> Int -> IO Int Source
fetch the previous value in an FPRef, and increment the FPRef by the given amount. This operation is atomic.
FPRef
addFetchFPRef :: FPRef Int -> Int -> IO Int Source
increment the FPRef by the given amount and return the new value. This operation is atomic.