8264788: Make SequentialSubTasksDone use-once

Reviewed-by: ayang, sjohanss
This commit is contained in:
Thomas Schatzl 2021-04-15 08:11:01 +00:00
parent 0793fcbbca
commit 125a8479a9
5 changed files with 23 additions and 91 deletions

View file

@ -2056,18 +2056,15 @@ public:
MarkFromRootsTask(uint active_workers) :
AbstractGangTask("MarkFromRootsTask"),
_strong_roots_scope(active_workers),
_subtasks(),
_subtasks(ParallelRootType::sentinel),
_terminator(active_workers, ParCompactionManager::oop_task_queues()),
_active_workers(active_workers) {
_subtasks.set_n_threads(active_workers);
_subtasks.set_n_tasks(ParallelRootType::sentinel);
}
virtual void work(uint worker_id) {
for (uint task = 0; _subtasks.try_claim_task(task); /*empty*/ ) {
mark_from_roots_work(static_cast<ParallelRootType::Value>(task), worker_id);
}
_subtasks.all_tasks_completed();
PCAddThreadRootsMarkingTaskClosure closure(worker_id);
Threads::possibly_parallel_threads_do(true /*parallel */, &closure);