mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8227101: Shenandoah: Use ShenandoahSharedFlag for claimed flag in ShenandoahSerialRoot
Reviewed-by: shade
This commit is contained in:
parent
3395bb591b
commit
803c03c094
2 changed files with 3 additions and 3 deletions
|
@ -41,11 +41,11 @@
|
||||||
#include "services/management.hpp"
|
#include "services/management.hpp"
|
||||||
|
|
||||||
ShenandoahSerialRoot::ShenandoahSerialRoot(ShenandoahSerialRoot::OopsDo oops_do, ShenandoahPhaseTimings::GCParPhases phase) :
|
ShenandoahSerialRoot::ShenandoahSerialRoot(ShenandoahSerialRoot::OopsDo oops_do, ShenandoahPhaseTimings::GCParPhases phase) :
|
||||||
_claimed(false), _oops_do(oops_do), _phase(phase) {
|
_oops_do(oops_do), _phase(phase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahSerialRoot::oops_do(OopClosure* cl, uint worker_id) {
|
void ShenandoahSerialRoot::oops_do(OopClosure* cl, uint worker_id) {
|
||||||
if (!_claimed && Atomic::cmpxchg(true, &_claimed, false) == false) {
|
if (_claimed.try_set()) {
|
||||||
ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
|
ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
|
||||||
ShenandoahWorkerTimingsTracker timer(worker_times, _phase, worker_id);
|
ShenandoahWorkerTimingsTracker timer(worker_times, _phase, worker_id);
|
||||||
_oops_do(cl);
|
_oops_do(cl);
|
||||||
|
|
|
@ -36,7 +36,7 @@ class ShenandoahSerialRoot {
|
||||||
public:
|
public:
|
||||||
typedef void (*OopsDo)(OopClosure*);
|
typedef void (*OopsDo)(OopClosure*);
|
||||||
private:
|
private:
|
||||||
volatile bool _claimed;
|
ShenandoahSharedFlag _claimed;
|
||||||
const OopsDo _oops_do;
|
const OopsDo _oops_do;
|
||||||
const ShenandoahPhaseTimings::GCParPhases _phase;
|
const ShenandoahPhaseTimings::GCParPhases _phase;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue