diff options
-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 |