diff options
author | jfrijters <jfrijters> | 2015-06-26 17:58:40 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2015-06-26 17:58:40 +0300 |
commit | 8ec0c04c96153d2dcfee298d6e69d190fe2aa65b (patch) | |
tree | 40982d3e65220964a52fe5039a8e86de7c65d540 | |
parent | b2ddeb8b1671ebd911e664751a7a1851fd86e03f (diff) |
Use (cheaper) InterlockedCompareAndSet "native" method instead of AtomicReferenceFieldUpdater.
-rw-r--r-- | openjdk/java/lang/Thread.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/openjdk/java/lang/Thread.java b/openjdk/java/lang/Thread.java index fefed5e3..1341a014 100644 --- a/openjdk/java/lang/Thread.java +++ b/openjdk/java/lang/Thread.java @@ -1747,10 +1747,11 @@ class Thread implements Runnable { // [IKVM] called by sun.misc.Launcher (via map.xml patch) to initialize the context class loader final void initContextClassLoader(ClassLoader cl) { // we only set contextClassLoader if it hasn't been set (by user code) previously - java.util.concurrent.atomic.AtomicReferenceFieldUpdater - .newUpdater(Thread.class, ClassLoader.class, "contextClassLoader") - .compareAndSet(this, ClassLoader.DUMMY, cl); + casContextClassLoader(ClassLoader.DUMMY, cl); } + + @ikvm.internal.InterlockedCompareAndSet("contextClassLoader") + private native boolean casContextClassLoader(ClassLoader oldValue, ClassLoader newValue); /** * Returns <tt>true</tt> if and only if the current thread holds the |