Making sure that dispatcher scheduling for shutdown is checked even if unregister throws up
This commit is contained in:
parent
39b374ba22
commit
1613ff5111
2 changed files with 24 additions and 6 deletions
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.dispatch;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
|
||||
abstract class AbstractMessageDispatcher {
|
||||
private volatile int _shutdownSchedule; // not initialized because this is faster: 0 == UNSCHEDULED
|
||||
protected final static AtomicIntegerFieldUpdater<AbstractMessageDispatcher> shutdownScheduleUpdater =
|
||||
AtomicIntegerFieldUpdater.newUpdater(AbstractMessageDispatcher.class, "_shutdownSchedule");
|
||||
|
||||
private volatile long _inhabitants; // not initialized because this is faster
|
||||
protected final static AtomicLongFieldUpdater<AbstractMessageDispatcher> inhabitantsUpdater =
|
||||
AtomicLongFieldUpdater.newUpdater(AbstractMessageDispatcher.class, "_inhabitants");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue