8369571: Parallel: Use ThreadsClaimTokenScope in PSAdjustTask

Reviewed-by: fandreuzzi, tschatzl
This commit is contained in:
Albert Mingkun Yang 2025-10-13 09:23:48 +00:00
parent 1605e8392e
commit 4728f746a8

View File

@ -1362,6 +1362,7 @@ void PSParallelCompact::adjust_pointers_in_spaces(uint worker_id, volatile uint*
}
class PSAdjustTask final : public WorkerTask {
ThreadsClaimTokenScope _threads_claim_token_scope;
SubTasksDone _sub_tasks;
WeakProcessor::Task _weak_proc_task;
OopStorageSetStrongParState<false, false> _oop_storage_iter;
@ -1377,16 +1378,12 @@ class PSAdjustTask final : public WorkerTask {
public:
PSAdjustTask(uint nworkers) :
WorkerTask("PSAdjust task"),
_threads_claim_token_scope(),
_sub_tasks(PSAdjustSubTask_num_elements),
_weak_proc_task(nworkers),
_nworkers(nworkers) {
ClassLoaderDataGraph::verify_claimed_marks_cleared(ClassLoaderData::_claim_stw_fullgc_adjust);
Threads::change_thread_claim_token();
}
~PSAdjustTask() {
Threads::assert_all_threads_claimed();
}
void work(uint worker_id) {