Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> , Roel van Dijk <vandijk.roel@gmail.com> |
---|
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 ( ... )
Documentation
Creating reentrant locks
Locking and unlocking
tryAcquire :: RLock -> IO BoolSource
Convenience functions
Querying reentrant locks
recursionLevel :: RLock -> IO IntegerSource