aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control/concurrency/semaphore.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/control/concurrency/semaphore.lux (renamed from stdlib/source/lux/concurrency/semaphore.lux)18
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/lux/concurrency/semaphore.lux b/stdlib/source/lux/control/concurrency/semaphore.lux
index 7b749ea60..46762ecf3 100644
--- a/stdlib/source/lux/concurrency/semaphore.lux
+++ b/stdlib/source/lux/control/concurrency/semaphore.lux
@@ -1,13 +1,13 @@
(.module:
[lux #*
[control [monad (#+ do)]]
- [concurrency
- ["." atom (#+ Atom)]
- ["." promise (#+ Promise)]]
["." io (#+ IO)]
[type
abstract
- ["." refinement]]])
+ ["." refinement]]]
+ [//
+ ["." atom (#+ Atom)]
+ ["." promise (#+ Promise)]])
(type: State
{#open-positions Nat
@@ -81,13 +81,13 @@
(-> Any Mutex)
(:abstraction (semaphore 1)))
- (def: (acquire mutex)
+ (def: acquire
(-> Mutex (Promise Any))
- (wait (:representation mutex)))
+ (|>> :representation wait))
- (def: (release mutex)
+ (def: release
(-> Mutex (Promise Any))
- (signal (:representation mutex)))
+ (|>> :representation signal))
(def: #export (synchronize mutex procedure)
(All [a] (-> Mutex (IO (Promise a)) (Promise a)))
@@ -138,7 +138,7 @@
(wait (get@ <turnstile> barrier))))]
[start inc limit #start-turnstile]
- [end dec 0 #end-turnstile]
+ [end dec 0 #end-turnstile]
)
(def: #export (block barrier)