diff options
Diffstat (limited to 'stdlib/source/test/lux/control/concurrency/semaphore.lux')
-rw-r--r-- | stdlib/source/test/lux/control/concurrency/semaphore.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux index f5b851104..60bd31050 100644 --- a/stdlib/source/test/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux @@ -40,7 +40,7 @@ ($_ _.and (do {! random.monad} [initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1)))) - #let [semaphore (/.semaphore initial_open_positions)]] + .let [semaphore (/.semaphore initial_open_positions)]] (in (do async.monad [result (async.time_out ..delay (/.wait semaphore))] (_.cover' [/.semaphore] @@ -52,7 +52,7 @@ false))))) (do {! random.monad} [initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1)))) - #let [semaphore (/.semaphore initial_open_positions)]] + .let [semaphore (/.semaphore initial_open_positions)]] (in (do {! async.monad} [_ (monad.map ! /.wait (list.repeat initial_open_positions semaphore)) result (async.time_out ..delay (/.wait semaphore))] @@ -65,10 +65,10 @@ true))))) (do {! random.monad} [initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1)))) - #let [semaphore (/.semaphore initial_open_positions)]] + .let [semaphore (/.semaphore initial_open_positions)]] (in (do {! async.monad} [_ (monad.map ! /.wait (list.repeat initial_open_positions semaphore)) - #let [block (/.wait semaphore)] + .let [block (/.wait semaphore)] result/0 (async.time_out ..delay block) open_positions (/.signal semaphore) result/1 (async.time_out ..delay block)] @@ -81,7 +81,7 @@ false))))) (do {! random.monad} [initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1)))) - #let [semaphore (/.semaphore initial_open_positions)]] + .let [semaphore (/.semaphore initial_open_positions)]] (in (do async.monad [outcome (/.signal semaphore)] (_.cover' [/.semaphore_is_maxed_out] @@ -99,7 +99,7 @@ ($_ _.and (do {! random.monad} [repetitions (|> random.nat (\ ! map (|>> (n.% 100) (n.max 10)))) - #let [resource (atom.atom "") + .let [resource (atom.atom "") expected_As (text.join_with "" (list.repeat repetitions "A")) expected_Bs (text.join_with "" (list.repeat repetitions "B")) mutex (/.mutex []) @@ -122,7 +122,7 @@ (in (do async.monad [_ processA _ processB - #let [outcome (io.run (atom.read resource))]] + .let [outcome (io.run (atom.read resource))]] (_.cover' [/.mutex /.synchronize] (or (text\= (format expected_As expected_Bs) outcome) @@ -156,10 +156,10 @@ false))) (do {! random.monad} [limit (\ ! map (|>> (n.% 9) inc) random.nat) - #let [barrier (/.barrier (maybe.assume (/.limit limit))) + .let [barrier (/.barrier (maybe.assume (/.limit limit))) resource (atom.atom "")]] (in (do {! async.monad} - [#let [suffix "_" + [.let [suffix "_" expected_ending (|> suffix (list.repeat limit) (text.join_with "")) @@ -169,7 +169,7 @@ (exec (io.run (atom.update (|>> (format suffix)) resource)) (waiter resource barrier id)))) (monad.seq !)) - #let [outcome (io.run (atom.read resource))]] + .let [outcome (io.run (atom.read resource))]] (_.cover' [/.barrier /.block] (and (text.ends_with? expected_ending outcome) (list.every? (function (_ id) |