aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/concurrency/atom.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/control/concurrency/atom.lux')
-rw-r--r--stdlib/source/library/lux/control/concurrency/atom.lux16
1 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux
index 9a86f191b..c6c993561 100644
--- a/stdlib/source/library/lux/control/concurrency/atom.lux
+++ b/stdlib/source/library/lux/control/concurrency/atom.lux
@@ -46,29 +46,29 @@
@.php "php array read"
@.scheme "scheme array read"}
(as_is))]
- (abstract: #export (Atom a)
+ (abstract: .public (Atom a)
+ {#.doc "Atomic references that are safe to mutate concurrently."}
+
(with_expansions [<jvm> (java/util/concurrent/atomic/AtomicReference a)]
(for {@.old <jvm>
@.jvm <jvm>}
(array.Array a)))
- {#.doc "Atomic references that are safe to mutate concurrently."}
-
- (def: #export (atom value)
+ (def: .public (atom value)
(All [a] (-> a (Atom a)))
(:abstraction (with_expansions [<jvm> (java/util/concurrent/atomic/AtomicReference::new value)]
(for {@.old <jvm>
@.jvm <jvm>}
(<write> 0 value (<new> 1))))))
- (def: #export (read atom)
+ (def: .public (read atom)
(All [a] (-> (Atom a) (IO a)))
(io (with_expansions [<jvm> (java/util/concurrent/atomic/AtomicReference::get (:representation atom))]
(for {@.old <jvm>
@.jvm <jvm>}
(<read> 0 (:representation atom))))))
- (def: #export (compare_and_swap current new atom)
+ (def: .public (compare_and_swap current new atom)
{#.doc (doc "Only mutates an atom if you can present its current value."
"That guarantees that atom was not updated since you last read from it.")}
(All [a] (-> a a (Atom a) (IO Bit)))
@@ -82,7 +82,7 @@
false))))))
))
-(def: #export (update f atom)
+(def: .public (update f atom)
{#.doc (doc "Updates an atom by applying a function to its current value."
"If it fails to update it (because some other process wrote to it first), it will retry until it succeeds."
"The retries will be done with the new values of the atom, as they show up.")}
@@ -96,7 +96,7 @@
(in [old new])
(recur [])))))
-(def: #export (write value atom)
+(def: .public (write value atom)
{#.doc (doc "Writes the given value to an atom."
"If it fails to write it (because some other process wrote to it first), it will retry until it succeeds.")}
(All [a] (-> a (Atom a) (IO a)))