Change order of boolean so the latch is decremented all the time

This commit is contained in:
Robin Lambertz 2013-06-17 00:27:00 +02:00 committed by md_5
parent 7fab3ba372
commit d9eb8c66b8

View File

@ -67,7 +67,7 @@ public class AsyncEvent<T> extends Event
{ {
Preconditions.checkState( intents.contains( plugin ), "Plugin %s has not registered intent for event %s", plugin, this ); Preconditions.checkState( intents.contains( plugin ), "Plugin %s has not registered intent for event %s", plugin, this );
intents.remove( plugin ); intents.remove( plugin );
if ( fired.get() && latch.decrementAndGet() == 0 ) if ( latch.decrementAndGet() == 0 && fired.get() )
{ {
done.done( (T) this, null ); done.done( (T) this, null );
} }