Files
engine.io-client-java/src/main/java
Sérgio Faria 794e24e879 The current EventThread doesn't need to be volatile
Citing the JLS (Java 7) §17.4.5:
> A call to start() on a thread happens-before any actions in
> the started thread.

Other threads calling isCurrent(), can see stale values of the static
variable, as it doesn't affect the result.

Nulling the thread variable, cannot be reordered with the new Thread because
a synchronized(EventThread.class) precedes the first task submission on a new
Executor, causing a happens-before relationship that ensures the null is
already visible to the thread on netTick (that will create the EventThread).
2014-08-28 21:42:10 +01:00
..