diff options
Diffstat (limited to 'stdlib/source/test/lux/control/concurrency/semaphore.lux')
-rw-r--r-- | stdlib/source/test/lux/control/concurrency/semaphore.lux | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux index 05329d9f0..bd5d72d43 100644 --- a/stdlib/source/test/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux @@ -10,6 +10,8 @@ ["." atom (#+ Atom)]]] [data ["." maybe] + [number + ["n" nat]] ["." text ("#;." equivalence monoid) ["%" format (#+ format)]] [collection @@ -21,7 +23,7 @@ ## (def: (wait-many-times times semaphore) ## (-> Nat /.Semaphore (Promise Any)) ## (loop [steps times] -## (if (n/> 0 steps) +## (if (n.> 0 steps) ## (do promise.monad ## [_ (/.wait semaphore)] ## (recur (dec steps))) @@ -30,7 +32,7 @@ ## (context: "Semaphore." ## (<| (times 100) ## (do @ -## [open-positions (|> r.nat (:: @ map (|>> (n/% 10) (n/max 1))))] +## [open-positions (|> r.nat (:: @ map (|>> (n.% 10) (n.max 1))))] ## ($_ seq ## (let [semaphore (/.semaphore open-positions)] ## (wrap (do promise.monad @@ -51,8 +53,8 @@ ## (let [semaphore (/.semaphore open-positions)] ## (wrap (do promise.monad ## [_ (: (Promise Any) -## (loop [steps (n/* 2 open-positions)] -## (if (n/> 0 steps) +## (loop [steps (n.* 2 open-positions)] +## (if (n.> 0 steps) ## (do @ ## [_ (/.wait semaphore) ## _ (/.signal semaphore)] @@ -82,7 +84,7 @@ ## (context: "Mutex." ## (<| (times 100) ## (do @ -## [repetitions (|> r.nat (:: @ map (|>> (n/% 100) (n/max 10))))] +## [repetitions (|> r.nat (:: @ map (|>> (n.% 100) (n.max 10))))] ## ($_ seq ## (let [mutex (/.mutex [])] ## (wrap (do promise.monad |