base-4.6.0.1: Basic libraries

Portability | non-portable (concurrency)
Stability | experimental
Maintainer | libraries@haskell.org
Safe Haskell | Trustworthy

Control.Concurrent.QSem

Contents

- Simple Quantity Semaphores

Description

Deprecated: Control.Concurrent.QSem will be removed in GHC 7.8. Please use an alternative, e.g. the SafeSemaphore package, instead.

Simple quantity semaphores.

Synopsis

- data QSem
- newQSem :: Int -> IO QSem
- waitQSem :: QSem -> IO ()
- signalQSem :: QSem -> IO ()

# Simple Quantity Semaphores

data QSem

A `QSem` is a simple quantity semaphore, in which the available "quantity" is always dealt with in units of one.

Instances

Eq QSem |
Typeable QSem |

newQSem :: Int -> IO QSem

Build a new `QSem` with a supplied initial quantity. The initial quantity must be at least 0.

waitQSem :: QSem -> IO ()

Wait for a unit to become available

signalQSem :: QSem -> IO ()

Signal that a unit of the `QSem` is available