mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-25 13:04:05 +00:00
8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots
Reviewed-by: ayang, wkemper
This commit is contained in:
parent
e8e2aadd9e
commit
b159ca097a
@ -58,9 +58,9 @@ void ShenandoahJavaThreadsIterator::threads_do(ThreadClosure* cl, uint worker_id
|
||||
}
|
||||
|
||||
ShenandoahThreadRoots::ShenandoahThreadRoots(ShenandoahPhaseTimings::Phase phase, bool is_par) :
|
||||
_phase(phase), _is_par(is_par) {
|
||||
Threads::change_thread_claim_token();
|
||||
}
|
||||
_phase(phase),
|
||||
_is_par(is_par),
|
||||
_threads_claim_token_scope() {}
|
||||
|
||||
void ShenandoahThreadRoots::oops_do(OopClosure* oops_cl, NMethodClosure* code_cl, uint worker_id) {
|
||||
ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::ThreadRoots, worker_id);
|
||||
@ -74,10 +74,6 @@ void ShenandoahThreadRoots::threads_do(ThreadClosure* tc, uint worker_id) {
|
||||
Threads::possibly_parallel_threads_do(_is_par, tc);
|
||||
}
|
||||
|
||||
ShenandoahThreadRoots::~ShenandoahThreadRoots() {
|
||||
Threads::assert_all_threads_claimed();
|
||||
}
|
||||
|
||||
ShenandoahCodeCacheRoots::ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase) : _phase(phase) {
|
||||
}
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#include "gc/shenandoah/shenandoahSharedVariables.hpp"
|
||||
#include "gc/shenandoah/shenandoahUtils.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "runtime/threads.hpp"
|
||||
|
||||
template <bool CONCURRENT>
|
||||
class ShenandoahVMWeakRoots {
|
||||
@ -87,10 +88,10 @@ public:
|
||||
class ShenandoahThreadRoots {
|
||||
private:
|
||||
ShenandoahPhaseTimings::Phase _phase;
|
||||
const bool _is_par;
|
||||
const bool _is_par;
|
||||
ThreadsClaimTokenScope _threads_claim_token_scope;
|
||||
public:
|
||||
ShenandoahThreadRoots(ShenandoahPhaseTimings::Phase phase, bool is_par);
|
||||
~ShenandoahThreadRoots();
|
||||
|
||||
void oops_do(OopClosure* oops_cl, NMethodClosure* code_cl, uint worker_id);
|
||||
void threads_do(ThreadClosure* tc, uint worker_id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user