MCPcopy Index your code
hub / github.com/clojure/clojure / enqueue

Method enqueue

src/jvm/clojure/lang/Agent.java:258–269  ·  view source on GitHub ↗
(Action action)

Source from the content-addressed store, hash-verified

256}
257
258void enqueue(Action action){
259 boolean queued = false;
260 ActionQueue prior = null;
261 while(!queued)
262 {
263 prior = aq.get();
264 queued = aq.compareAndSet(prior, new ActionQueue((IPersistentStack)prior.q.cons(action), prior.error));
265 }
266
267 if(prior.q.count() == 0 && prior.error == null)
268 action.execute();
269}
270
271public int getQueueCount(){
272 return aq.get().q.count();

Callers 2

dispatchActionMethod · 0.45
releasePendingSendsMethod · 0.45

Calls 5

getMethod · 0.65
compareAndSetMethod · 0.65
consMethod · 0.65
countMethod · 0.65
executeMethod · 0.45

Tested by

no test coverage detected