summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2007-09-22 17:15:54 +0000
committerRich Hickey <richhickey@gmail.com>2007-09-22 17:15:54 +0000
commitf1992b7337c4fc1e8c793391ac60dec74e18e95d (patch)
treeb1d7cde94c4866807ec5c76291cb0383e610c2be /src
parentc16ce61aeb730ccd3ab03fc51ca6437e42e752a2 (diff)
doc update
Diffstat (limited to 'src')
-rw-r--r--src/boot.clj12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/boot.clj b/src/boot.clj
index 53fd5842..46287788 100644
--- a/src/boot.clj
+++ b/src/boot.clj
@@ -301,10 +301,14 @@
(defn commute [#^Ref ref fun]
(. ref (commute fun)))
-(defn set [#^Ref ref val]
- (. ref (set val)))
-
-(defmacro sync [& body]
+(defn set
+ ([#^Ref ref]
+ (. ref (touch))
+ (. ref (get)))
+ ([#^Ref ref val]
+ (. ref (set val))))
+
+(defmacro sync [flags-ignored-for-now & body]
`(. clojure.lang.LockingTransaction
(runInTransaction (fn [] ~@body))))