diff options
author | Chouser <chouser@n01se.net> | 2010-11-07 22:09:38 -0500 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-11-29 20:57:30 -0500 |
commit | 7e38388e522b1e09dc02157113174640bb32e6ab (patch) | |
tree | 23b38067950bcbad3796fc6eb2a3353acdfcf97c /src | |
parent | 460ba9ba5c6dd4df728316f934a38498da901e8c (diff) |
Restore *agent* binding in agent action. CLJ-672
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/clj/clojure/core.clj | 6 | ||||
-rw-r--r-- | src/jvm/clojure/lang/Agent.java | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index ed240193..ec81a5cc 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -1821,7 +1821,8 @@ {:added "1.0" :static true} [^clojure.lang.Agent a f & args] - (. a (dispatch (binding-conveyor-fn f) args false))) + (binding [*agent* a] + (.dispatch a (binding-conveyor-fn f) args false))) (defn send-off "Dispatch a potentially blocking action to an agent. Returns the @@ -1832,7 +1833,8 @@ {:added "1.0" :static true} [^clojure.lang.Agent a f & args] - (. a (dispatch (binding-conveyor-fn f) args true))) + (binding [*agent* a] + (.dispatch a (binding-conveyor-fn f) args true))) (defn release-pending-sends "Normally, actions sent directly or indirectly during another action diff --git a/src/jvm/clojure/lang/Agent.java b/src/jvm/clojure/lang/Agent.java index 0ba7c167..67230bfc 100644 --- a/src/jvm/clojure/lang/Agent.java +++ b/src/jvm/clojure/lang/Agent.java @@ -107,7 +107,6 @@ static class Action implements Runnable{ static void doRun(Action action){ try { - Var.pushThreadBindings(RT.map(RT.AGENT, action.agent)); nested.set(PersistentVector.EMPTY); Throwable error = null; @@ -159,7 +158,6 @@ static class Action implements Runnable{ finally { nested.set(null); - Var.popThreadBindings(); } } |