mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-12 21:45:05 +00:00
8385901: G1: G1FullGCPrepareTask::_has_free_compaction_targets should be Atomic
Reviewed-by: ayang, iwalulya
This commit is contained in:
parent
55a53f945f
commit
baf0f45fc7
@ -60,13 +60,13 @@ G1FullGCPrepareTask::G1FullGCPrepareTask(G1FullCollector* collector) :
|
||||
}
|
||||
|
||||
void G1FullGCPrepareTask::set_has_free_compaction_targets() {
|
||||
if (!_has_free_compaction_targets) {
|
||||
_has_free_compaction_targets = true;
|
||||
if (!has_free_compaction_targets()) {
|
||||
_has_free_compaction_targets.store_relaxed(true);
|
||||
}
|
||||
}
|
||||
|
||||
bool G1FullGCPrepareTask::has_free_compaction_targets() {
|
||||
return _has_free_compaction_targets;
|
||||
return _has_free_compaction_targets.load_relaxed();
|
||||
}
|
||||
|
||||
void G1FullGCPrepareTask::work(uint worker_id) {
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include "gc/g1/g1FullGCTask.hpp"
|
||||
#include "gc/g1/g1HeapRegion.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
|
||||
class G1CollectedHeap;
|
||||
class G1CMBitMap;
|
||||
@ -61,7 +62,7 @@ public:
|
||||
};
|
||||
|
||||
class G1FullGCPrepareTask : public G1FullGCTask {
|
||||
volatile bool _has_free_compaction_targets;
|
||||
Atomic<bool> _has_free_compaction_targets;
|
||||
G1HeapRegionClaimer _hrclaimer;
|
||||
|
||||
void set_has_free_compaction_targets();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user