Skip to content

Commit

Permalink
8248149: G1: change _cleaning_claimed from int to bool
Browse files Browse the repository at this point in the history
Reviewed-by: lkorinth, ayang, kbarrett
  • Loading branch information
Thomas Schatzl committed Jun 16, 2023
1 parent c2b043e commit fb024fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/g1/g1ParallelCleaning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@

#if INCLUDE_JVMCI
JVMCICleaningTask::JVMCICleaningTask() :
_cleaning_claimed(0) {
_cleaning_claimed(false) {
}

bool JVMCICleaningTask::claim_cleaning_task() {
if (_cleaning_claimed) {
if (Atomic::load(&_cleaning_claimed)) {
return false;
}

return Atomic::cmpxchg(&_cleaning_claimed, 0, 1) == 0;
return !Atomic::cmpxchg(&_cleaning_claimed, false, true);
}

void JVMCICleaningTask::work(bool unloading_occurred) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1ParallelCleaning.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#if INCLUDE_JVMCI
class JVMCICleaningTask : public StackObj {
volatile int _cleaning_claimed;
volatile bool _cleaning_claimed;

public:
JVMCICleaningTask();
Expand Down

1 comment on commit fb024fd

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.