mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 20:23:11 +03:00
15 lines
350 B
Idris
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
|
|
|