Idris2/tests/racket/mutex002/Main.idr
2021-03-15 13:43:12 +00:00

15 lines
350 B
Idris

-- Idris2
import System.Concurrency
||| Test basic lock/acquire and unlock/release functionality from child thread
main : IO ()
main =
do m <- makeMutex
t <- fork $ do mutexAcquire m
putStrLn "Child acquired mutex"
mutexRelease m
putStrLn "Child released mutex"
threadWait t