(Action action)
| 256 | } |
| 257 | |
| 258 | void 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 | |
| 271 | public int getQueueCount(){ |
| 272 | return aq.get().q.count(); |
no test coverage detected