LightArrayRevolverScheduler, see #2904

- based on a wheel (AtomicReferenceArray) from which atomic
  single-linked lists dangle
- no locks
- deterministic tests due to overridable time source
- also bring docs up to date
This commit is contained in:
Roland 2013-01-14 23:21:51 +01:00
parent 9f2a0afc05
commit 8dea20a1f1
20 changed files with 863 additions and 202 deletions

View file

@ -457,10 +457,11 @@ public class HashedWheelTimer implements Timer {
return Unsafe.instance.compareAndSwapInt(this, _stateOffset, old, future);
}
public void cancel() {
public boolean cancel() {
if (updateState(ST_INIT, ST_CANCELLED)) {
parent.wheel[stopIndex].remove(this);
}
return true;
} else return false;
}
public boolean isCancelled() {