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

Safe HaskellNone

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 IntSource

fetch the previous value in an FPRef, and increment the FPRef by the given amount. This operation is atomic.

addFetchFPRef :: FPRef Int -> Int -> IO IntSource

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