[project @ 1996-06-27 16:55:06 by partain]
[ghc-hetmet.git] / ghc / lib / concurrent / ChannelVar.hs
similarity index 85%
rename from ghc/lib/prelude/ChannelVar.lhs
rename to ghc/lib/concurrent/ChannelVar.hs
index d10721e..aa78301 100644 (file)
@@ -1,3 +1,4 @@
+{-
 %
 % (c) The GRASP/AQUA Project, Glasgow University, 1995
 %
@@ -7,6 +8,7 @@ Channel variables, are one-element channels described in the Concurrent
 Haskell paper (available from @ftp://ftp.dcs.gla.ac.uk/pub/glasgow-fp/drafts@)
 
 \begin{code}
+-}
 module ChannelVar
        (
         {- abstract -}
@@ -14,14 +16,12 @@ module ChannelVar
         newCVar,       --:: IO (CVar a)
         putCVar,       --:: CVar a -> a -> IO ()
         getCVar,       --:: CVar a -> IO a
-        _MVar
+        MVar
 
        ) where
 
-import PreludeGlaST
-import PreludePrimIO   ( newEmptyMVar, newMVar, putMVar,
-                         readMVar, takeMVar, _MVar
-                       )
+import GHCbase
+{-
 \end{code}
 
 @MVars@ provide the basic mechanisms for synchronising access to a shared
@@ -31,10 +31,11 @@ access to the channel variable,i.e., a producer is forced to wait up for
 a consumer to remove the previous value before it can deposit a new one in the @CVar@.
 
 \begin{code}
+-}
 
 data CVar a
- = CVar (_MVar a)     -- prod -> cons
-        (_MVar ())    -- cons -> prod
+ = CVar (MVar a)     -- prod -> cons
+        (MVar ())    -- cons -> prod
 
 newCVar :: IO (CVar a)
 putCVar :: CVar a -> a -> IO ()
@@ -54,5 +55,3 @@ getCVar (CVar datum ack)
  = takeMVar datum >>= \ val ->
    putMVar ack () >> 
    return val
-
-\end{code}