shared-buffer-0.2.2: A circular buffer built on shared memory

Safe HaskellNone
LanguageHaskell98

System.Posix.AtomicOps

Contents

Synopsis

types

data FPRef a Source

A reference to a value held in a Foreign Ptr

basic interface

newFPRef :: Storable a => a -> IO (FPRef a) Source

writeFPRef :: Storable a => FPRef a -> a -> IO () Source

FPRef Int operations

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.

addFetchFPRef :: FPRef Int -> Int -> IO Int Source

increment the FPRef by the given amount and return the new value. This operation is atomic.