--- old/src/hotspot/os/windows/threadCritical_windows.cpp 2019-11-21 11:56:47.030589564 +0100 +++ new/src/hotspot/os/windows/threadCritical_windows.cpp 2019-11-21 11:56:46.538581251 +0100 @@ -56,7 +56,7 @@ if (lock_owner != current_thread) { // Grab the lock before doing anything. - while (Atomic::cmpxchg(0, &lock_count, -1) != -1) { + while (Atomic::cmpxchg(&lock_count, -1, 0) != -1) { if (initialized) { DWORD ret = WaitForSingleObject(lock_event, INFINITE); assert(ret == WAIT_OBJECT_0, "unexpected return value from WaitForSingleObject");