mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 09:12:34 +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
|
|
|