--- a/src/hotspot/share/compiler/compileBroker.hpp Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/compiler/compileBroker.hpp Mon Nov 25 12:33:15 2019 +0100
@@ -335,7 +335,7 @@
static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); }
static bool set_should_compile_new_jobs(jint new_state) {
// Return success if the current caller set it
- jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state);
+ jint old = Atomic::cmpxchg(&_should_compile_new_jobs, 1-new_state, new_state);
bool success = (old == (1-new_state));
if (success) {
if (new_state == run_compilation) {
@@ -359,7 +359,7 @@
static void handle_full_code_cache(int code_blob_type);
// Ensures that warning is only printed once.
static bool should_print_compiler_warning() {
- jint old = Atomic::cmpxchg(1, &_print_compilation_warning, 0);
+ jint old = Atomic::cmpxchg(&_print_compilation_warning, 0, 1);
return old == 0;
}
// Return total compilation ticks