lio-0.9.1.1: Labeled IO Information Flow Control Library

Safe HaskellUnsafe

LIO.Concurrent.LMVar.TCB

Contents

Description

This module implements the core of labeled MVarss in the 'LIO ad. to Control.Concurrent.MVar, but the operations take place in the LIO monad. The types and functions exported by this module are strictly TCB and do not perform any information flow checks. The external, safe interface is provided and documented in LIO.Concurrent.LMVar.

Synopsis

Documentation

data LMVar l a Source

An LMVar is a labeled synchronization variable (an MVar) that can be used by concurrent threads to communicate.

Constructors

LMVarTCB 

Fields

labelOfLMVar :: !l

Label of MVar.

unlabelLMVarTCB :: MVar a

Access the underlying MVar, ignoring IFC.

Instances

Creating labeled MVars

newEmptyLMVarTCB :: MonadLIO l m => l -> m (LMVar l a)Source

Trusted function used to create an empty LMVar, ignoring IFC.

newLMVarTCB :: MonadLIO l m => l -> a -> m (LMVar l a)Source

Trusted function used to create an LMVar with the supplied value, ignoring IFC.

Take LMVar

takeLMVarTCB :: MonadLIO l m => LMVar l a -> m aSource

Read the contents of an LMVar, ignoring IFC.

tryTakeLMVarTCB :: MonadLIO l m => LMVar l a -> m (Maybe a)Source

Same as tryTakeLMVar, but ignorses IFC.

Put LMVar

putLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m ()Source

Put a value into an LMVar, ignoring IFC.

tryPutLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m BoolSource

Same as tryPutLMVar, but ignorses IFC.

Read LMVar

readLMVarTCB :: MonadLIO l m => LMVar l a -> m aSource

Trusted function used to read (take and put) an LMVar, ignoring IFC.

Swap LMVar

swapLMVarTCB :: MonadLIO l m => LMVar l a -> a -> m aSource

Trusted function that swaps value of LMVar, ignoring IFC.

Check state of LMVar

isEmptyLMVarTCB :: MonadLIO l m => LMVar l a -> m BoolSource

Same as isEmptyLMVar, but ignorses IFC.