Idris2/tests/chez/barrier001/Main.idr
Wen Kokke bd683938bf
Overhaul of concurrency primitives (#968)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-02-05 16:16:20 +00:00

16 lines
306 B
Idris

module Main
import System
import System.Concurrency
main : IO ()
main = do
barrier <- makeBarrier 3
threadIDs <- for [1,2,3] $ \n => fork $ do
putStrLn "Hello"
barrierWait barrier
putStrLn "Goodbye"
for threadIDs $ \threadID =>
threadWait threadID
sleep 1