mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8165858: heapRegionManager is missing volatile specifier for _claims
Added volatile specifier. Reviewed-by: kbarrett, tschatzl
This commit is contained in:
parent
c0c4200524
commit
1d00efa1c6
2 changed files with 6 additions and 6 deletions
|
@ -482,8 +482,9 @@ void HeapRegionManager::verify_optional() {
|
||||||
HeapRegionClaimer::HeapRegionClaimer(uint n_workers) :
|
HeapRegionClaimer::HeapRegionClaimer(uint n_workers) :
|
||||||
_n_workers(n_workers), _n_regions(G1CollectedHeap::heap()->_hrm._allocated_heapregions_length), _claims(NULL) {
|
_n_workers(n_workers), _n_regions(G1CollectedHeap::heap()->_hrm._allocated_heapregions_length), _claims(NULL) {
|
||||||
assert(n_workers > 0, "Need at least one worker.");
|
assert(n_workers > 0, "Need at least one worker.");
|
||||||
_claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC);
|
uint* new_claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC);
|
||||||
memset(_claims, Unclaimed, sizeof(*_claims) * _n_regions);
|
memset(new_claims, Unclaimed, sizeof(*_claims) * _n_regions);
|
||||||
|
_claims = new_claims;
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapRegionClaimer::~HeapRegionClaimer() {
|
HeapRegionClaimer::~HeapRegionClaimer() {
|
||||||
|
|
|
@ -261,7 +261,7 @@ public:
|
||||||
class HeapRegionClaimer : public StackObj {
|
class HeapRegionClaimer : public StackObj {
|
||||||
uint _n_workers;
|
uint _n_workers;
|
||||||
uint _n_regions;
|
uint _n_regions;
|
||||||
uint* _claims;
|
volatile uint* _claims;
|
||||||
|
|
||||||
static const uint Unclaimed = 0;
|
static const uint Unclaimed = 0;
|
||||||
static const uint Claimed = 1;
|
static const uint Claimed = 1;
|
||||||
|
@ -285,4 +285,3 @@ class HeapRegionClaimer : public StackObj {
|
||||||
bool claim_region(uint region_index);
|
bool claim_region(uint region_index);
|
||||||
};
|
};
|
||||||
#endif // SHARE_VM_GC_G1_HEAPREGIONMANAGER_HPP
|
#endif // SHARE_VM_GC_G1_HEAPREGIONMANAGER_HPP
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue