concurrent-extra-0.1: Extra concurrency primitives

MaintainerBas van Dijk <v.dijk.bas@gmail.com> , Roel van Dijk <vandijk.roel@gmail.com>

Control.Concurrent.RLock

Contents

Description

This module provides the RLock synchronization mechanism. It was inspired by the Python RLock and Java ReentrantLock objects and should behave in a similar way. See:

http://docs.python.org/3.1/library/threading.html#rlock-objects

and:

http://java.sun.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantLock.html

All functions are exception safe. Throwing asynchronous exceptions will not compromise the internal state of a RLock.

This module is intended to be imported qualified. We suggest importing it like:

 import           Control.Concurrent.RLock          ( RLock )
 import qualified Control.Concurrent.RLock as RLock ( ... )

Synopsis

Documentation

data RLock Source

Instances

Creating reentrant locks

Locking and unlocking

Convenience functions

with :: RLock -> IO α -> IO αSource

tryWith :: RLock -> IO α -> IO (Maybe α)Source

Querying reentrant locks