Idris2/tests/racket/semaphores002/Main.idr

15 lines
253 B
Idris
Raw Normal View History

module Main
import System.Concurrency
main : IO ()
main = do
sema <- makeSemaphore 0
fork $ do
putStrLn "Hello"
semaphorePost sema
semaphorePost sema
semaphoreWait sema
semaphoreWait sema
putStrLn "Goodbye"