src/hotspot/share/prims/jni.cpp
changeset 59251 4cbfa5077d68
parent 59248 e92153ed8bdc
child 59252 623722a6aeb9
--- a/src/hotspot/share/prims/jni.cpp	Mon Nov 25 12:32:07 2019 +0100
+++ b/src/hotspot/share/prims/jni.cpp	Mon Nov 25 12:32:40 2019 +0100
@@ -3811,9 +3811,9 @@
 #if defined(ZERO) && defined(ASSERT)
   {
     jint a = 0xcafebabe;
-    jint b = Atomic::xchg((jint) 0xdeadbeef, &a);
+    jint b = Atomic::xchg(&a, (jint) 0xdeadbeef);
     void *c = &a;
-    void *d = Atomic::xchg(&b, &c);
+    void *d = Atomic::xchg(&c, &b);
     assert(a == (jint) 0xdeadbeef && b == (jint) 0xcafebabe, "Atomic::xchg() works");
     assert(c == &b && d == &a, "Atomic::xchg() works");
   }
@@ -3829,10 +3829,10 @@
   // We use Atomic::xchg rather than Atomic::add/dec since on some platforms
   // the add/dec implementations are dependent on whether we are running
   // on a multiprocessor Atomic::xchg does not have this problem.
-  if (Atomic::xchg(1, &vm_created) == 1) {
+  if (Atomic::xchg(&vm_created, 1) == 1) {
     return JNI_EEXIST;   // already created, or create attempt in progress
   }
-  if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) {
+  if (Atomic::xchg(&safe_to_recreate_vm, 0) == 0) {
     return JNI_ERR;  // someone tried and failed and retry not allowed.
   }