Skip to content

Commit

Permalink
8308594: Use atomic bitset function for PackageEntry::_defined_by_cds…
Browse files Browse the repository at this point in the history
…_in_class_path

Reviewed-by: coleenp, lfoltan
  • Loading branch information
calvinccheung committed May 26, 2023
1 parent c72b547 commit 55d297f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/hotspot/share/classfile/packageEntry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,7 @@ class PackageEntry : public CHeapObj<mtModule> {
}
void set_defined_by_cds_in_class_path(int idx) {
assert(idx < max_index_for_defined_in_class_path(), "sanity");
int old_val = 0;
int new_val = 0;
do {
old_val = Atomic::load(&_defined_by_cds_in_class_path);
new_val = old_val | ((int)1 << idx);
} while (Atomic::cmpxchg(&_defined_by_cds_in_class_path, old_val, new_val) != old_val);
Atomic::fetch_then_or(&_defined_by_cds_in_class_path, ((int)1 << idx));
}
};

Expand Down

1 comment on commit 55d297f

@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.