mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
8264788: Make SequentialSubTasksDone use-once
Reviewed-by: ayang, sjohanss
This commit is contained in:
parent
0793fcbbca
commit
125a8479a9
5 changed files with 23 additions and 91 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue