Adding AbstractPromise to create an AtomicReferenceFieldUpdater to get rid of the AtomicReference allocation

This commit is contained in:
Viktor Klang 2011-10-04 21:17:01 +02:00
parent c4508a3e26
commit 56f8f858be
2 changed files with 32 additions and 11 deletions

View file

@ -0,0 +1,15 @@
/**
* Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.dispatch;
import sun.tools.tree.FinallyStatement;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
abstract class AbstractPromise {
private volatile Object _ref = FState.apply();
protected final static AtomicReferenceFieldUpdater<AbstractPromise, Object> updater =
AtomicReferenceFieldUpdater.newUpdater(AbstractPromise.class, Object.class, "_ref");
}