jdonaldson/promhx — pull request #40 by vizanto (2014-10-29 15:46:56+00:00)
Title: Make EventLoop queueing thread safe on the JVM.

Haxe's `List ` class is not thread-safe.

Here's a sample stack trace of resolving a Deferred in a function called by `haxe.Timer.delay`:
```
java.lang.NullPointerException
at haxe.root.List.pop(Unknown Source)
at promhx.base.EventLoop_continueOnNextLoop_55__Fun.__hx_invoke0_o(Unknown Source)
at promhx.base.EventLoop.continueOnNextLoop(Unknown Source)
at promhx.base.AsyncBase._resolve(Unknown Source)
at promhx.base.AsyncBase.handleResolve(Unknown Source)
at promhx.Deferred.resolve(Unknown Source)
```

This change uses `java.vm.AtomicList` instead of `List`, but makes it impossible to implement `queueLength` without locking. Instead, I replaced it with `queueEmpty`.