mirror of
https://github.com/idris-lang/Idris2.git
synced 2025-01-08 17:01:15 +03:00
bd683938bf
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
22 lines
358 B
Idris
22 lines
358 B
Idris
module Main
|
|
|
|
import Debug.Trace
|
|
import System
|
|
import System.Concurrency
|
|
|
|
main : IO ()
|
|
main = do
|
|
mutex <- makeMutex
|
|
cond <- makeCondition
|
|
|
|
threadID <- fork $ do
|
|
mutexAcquire mutex
|
|
conditionWait cond mutex
|
|
putStrLn "Goodbye"
|
|
mutexRelease mutex
|
|
|
|
putStrLn "Hello"
|
|
conditionSignal cond
|
|
|
|
threadWait threadID
|