< prev index next >
src/hotspot/os/windows/os_windows.cpp
Print this page
@@ -2094,11 +2094,11 @@
static int check_pending_signals() {
while (true) {
for (int i = 0; i < NSIG + 1; i++) {
jint n = pending_signals[i];
- if (n > 0 && n == Atomic::cmpxchg(n - 1, &pending_signals[i], n)) {
+ if (n > 0 && n == Atomic::cmpxchg(&pending_signals[i], n, n - 1)) {
return i;
}
}
JavaThread *thread = JavaThread::current();
@@ -3749,11 +3749,11 @@
warning("crit_sect initialization failed in %s: %d\n", __FILE__, __LINE__);
} else if (Atomic::load_acquire(&process_exiting) == 0) {
if (what != EPT_THREAD) {
// Atomically set process_exiting before the critical section
// to increase the visibility between racing threads.
- Atomic::cmpxchg(GetCurrentThreadId(), &process_exiting, (DWORD)0);
+ Atomic::cmpxchg(&process_exiting, (DWORD)0, GetCurrentThreadId());
}
EnterCriticalSection(&crit_sect);
if (what == EPT_THREAD && Atomic::load_acquire(&process_exiting) == 0) {
// Remove from the array those handles of the threads that have completed exiting.
@@ -5134,11 +5134,11 @@
// Consider: use atomic decrement instead of CAS-loop
int v;
for (;;) {
v = _Event;
- if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
+ if (Atomic::cmpxchg(&_Event, v, v-1) == v) break;
}
guarantee((v == 0) || (v == 1), "invariant");
if (v != 0) return OS_OK;
// Do this the hard way by blocking ...
@@ -5196,11 +5196,11 @@
// may call park().
// Consider: use atomic decrement instead of CAS-loop
int v;
for (;;) {
v = _Event;
- if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
+ if (Atomic::cmpxchg(&_Event, v, v-1) == v) break;
}
guarantee((v == 0) || (v == 1), "invariant");
if (v != 0) return;
// Do this the hard way by blocking ...
< prev index next >