From a13d69bfcfcbb4317d3d0e80b88f70dda98a8994 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Thu, 28 Feb 2008 23:44:43 +0000 Subject: [PATCH] untabify --- Control/Concurrent/QSem.hs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Control/Concurrent/QSem.hs b/Control/Concurrent/QSem.hs index 5a512d8..0258810 100644 --- a/Control/Concurrent/QSem.hs +++ b/Control/Concurrent/QSem.hs @@ -13,12 +13,12 @@ ----------------------------------------------------------------------------- module Control.Concurrent.QSem - ( -- * Simple Quantity Semaphores - QSem, -- abstract - newQSem, -- :: Int -> IO QSem - waitQSem, -- :: QSem -> IO () - signalQSem -- :: QSem -> IO () - ) where + ( -- * Simple Quantity Semaphores + QSem, -- abstract + newQSem, -- :: Int -> IO QSem + waitQSem, -- :: QSem -> IO () + signalQSem -- :: QSem -> IO () + ) where import Prelude import Control.Concurrent.MVar @@ -54,13 +54,13 @@ waitQSem (QSem sem) = do else do block <- newEmptyMVar {- - Stuff the reader at the back of the queue, - so as to preserve waiting order. A signalling - process then only have to pick the MVar at the - front of the blocked list. + Stuff the reader at the back of the queue, + so as to preserve waiting order. A signalling + process then only have to pick the MVar at the + front of the blocked list. - The version of waitQSem given in the paper could - lead to starvation. + The version of waitQSem given in the paper could + lead to starvation. -} putMVar sem (0, blocked++[block]) takeMVar block @@ -73,5 +73,5 @@ signalQSem (QSem sem) = do [] -> putMVar sem (avail+1,[]) (block:blocked') -> do - putMVar sem (0,blocked') - putMVar block () + putMVar sem (0,blocked') + putMVar block () -- 1.7.10.4