diff options
Diffstat (limited to 'ghc/lib/prelude/Concurrent.hi')
-rw-r--r-- | ghc/lib/prelude/Concurrent.hi | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/ghc/lib/prelude/Concurrent.hi b/ghc/lib/prelude/Concurrent.hi new file mode 100644 index 0000000000..29976ccd5b --- /dev/null +++ b/ghc/lib/prelude/Concurrent.hi @@ -0,0 +1,93 @@ +{-# GHC_PRAGMA INTERFACE VERSION 5 #-} +interface Concurrent where +import Channel(Chan(..), dupChan, getChan, getChanContents, newChan, putChan, unGetChan) +import ChannelVar(CVar(..), getCVar, newCVar, putCVar) +import Merge(mergeIO, nmergeIO) +import Parallel(par, seq) +import PreludeIOError(IOError13) +import PreludeMonadicIO(Either) +import PreludePrimIO(IVar(..), MVar(..), _IVar, _MVar, newEmptyMVar, newIVar, newMVar, putMVar, readIVar, readMVar, swapMVar, takeMVar, threadDelay, threadWait, writeIVar) +import SampleVar(SampleVar(..), emptySampleVar, newSampleVar, readSample, writeSample) +import Semaphore(QSem(..), QSemN(..), newQSem, newQSemN, signalQSem, signalQSemN, waitQSem, waitQSemN) +infixr 0 `par` +infixr 1 `seq` +data Chan a +data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-} +type IVar a = _IVar a +type MVar a = _MVar a +data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-} +data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-} +type SampleVar a = _MVar (Int, _MVar a) +data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-} +data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-} +dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-} +emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +forkIO :: (_State _RealWorld -> (Either IOError13 (), _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-} +getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-} +getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-} +newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld) + {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-} +putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-} +unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-} +getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-} +newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld) + {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-} +putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-} +mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-} +nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-} +par :: a -> b -> b + {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-} +seq :: a -> b -> b + {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-} +newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld) + {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-} +newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld) + {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-} +newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-} +readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-} +takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-} +newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld) + {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-} +readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-} +newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-} +waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-} +waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld) + {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-} + |