8234740: Harmonize parameter order in Atomic - cmpxchg

Reviewed-by: rehn, dholmes
This commit is contained in:
Stefan Karlsson 2019-11-25 12:33:15 +01:00
parent 3d426623bf
commit 0ad50c2b5c
144 changed files with 504 additions and 506 deletions

View file

@ -1586,7 +1586,7 @@ class AttachDetach : public StackObj {
jint res = main_vm.AttachCurrentThread((void**)&hotspotEnv, NULL);
_attached = res == JNI_OK;
static volatile int report_attach_error = 0;
if (res != JNI_OK && report_attach_error == 0 && Atomic::cmpxchg(1, &report_attach_error, 0) == 0) {
if (res != JNI_OK && report_attach_error == 0 && Atomic::cmpxchg(&report_attach_error, 0, 1) == 0) {
// Only report an attach error once
jio_printf("Warning: attaching current thread to VM failed with %d (future attach errors are suppressed)\n", res);
}
@ -1599,7 +1599,7 @@ class AttachDetach : public StackObj {
extern struct JavaVM_ main_vm;
jint res = main_vm.DetachCurrentThread();
static volatile int report_detach_error = 0;
if (res != JNI_OK && report_detach_error == 0 && Atomic::cmpxchg(1, &report_detach_error, 0) == 0) {
if (res != JNI_OK && report_detach_error == 0 && Atomic::cmpxchg(&report_detach_error, 0, 1) == 0) {
// Only report an attach error once
jio_printf("Warning: detaching current thread from VM failed with %d (future attach errors are suppressed)\n", res);
}