diff options
author | Mariot Chauvin <mariot.chauvin@gmail.com> | 2015-02-10 15:15:29 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-07-29 16:53:18 -0700 |
commit | c201eac291682a9bdb9ca2790403084b4f36da76 (patch) | |
tree | 8b8ddbceac81460547d98178d969a81b5e083f63 /compare-build-dirs-ignore-patterns | |
parent | a745f06e35e070061348e95725afb0def8ca45de (diff) | |
download | scala-c201eac291682a9bdb9ca2790403084b4f36da76.tar.gz scala-c201eac291682a9bdb9ca2790403084b4f36da76.tar.bz2 scala-c201eac291682a9bdb9ca2790403084b4f36da76.zip |
SI-8362: AbstractPromise extends AtomicReference
To avoid `sun.misc.Unsafe`, which is not supported on Google App Engine.
Deprecate `AbstractPromise` --> extend `j.u.c.atomic.AtomicReference` directly.
`AtomicReference.compareAndSet()` should also provide better performance on
HotSpot, which compiles it down to the machine's CAS instruction.
The binary incompatible change is ok because it's in an internal package.
I can't think of any real issue with adding a superclass (which contributes
only final methods) to a class in an implementation package (as long as
those methods were not introduced in any illicit subclasses of said class).
Instead of changing `DefaultPromise`'s super class, let's be more
conservative, and do it closest to the source. This is both clearer and more
focussed, leaving those subclasses of AbstractPromise we never heard of
unaffected.
Genesis of the commit: since the work on `Future` performance, `AbstractPromise`
is using `Unsafe`, breaking the ability for `Future` to be executed on GAE. At
that time, viktorklang suggested to implement a fallback in case `Unsafe` is
not available. carey proposed an implementation, and mchv submitted a patch,
which was refined by adriaanm.
Diffstat (limited to 'compare-build-dirs-ignore-patterns')
0 files changed, 0 insertions, 0 deletions