mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-21 02:31:50 +03:00
25 lines
388 B
Idris
25 lines
388 B
Idris
module Main
|
|
|
|
import Debug.Trace
|
|
import System
|
|
import System.Concurrency
|
|
|
|
-- Signal from child
|
|
|
|
main : IO ()
|
|
main = do
|
|
mutex <- makeMutex
|
|
cond <- makeCondition
|
|
|
|
threadID <- fork $ do
|
|
putStrLn "Hello"
|
|
sleep 1
|
|
conditionSignal cond
|
|
|
|
mutexAcquire mutex
|
|
conditionWait cond mutex
|
|
putStrLn "Goodbye"
|
|
mutexRelease mutex
|
|
|
|
threadWait threadID
|