Skip to content

Commit 9ee0b9a

Browse files
committed
8264052: Shenandoah: Backout 8263832
Reviewed-by: shade
1 parent e55aa41 commit 9ee0b9a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,23 @@ class ShenandoahSATBAndRemarkThreadsClosure : public ThreadClosure {
9696
private:
9797
SATBMarkQueueSet& _satb_qset;
9898
OopClosure* const _cl;
99+
uintx _claim_token;
99100

100101
public:
101102
ShenandoahSATBAndRemarkThreadsClosure(SATBMarkQueueSet& satb_qset, OopClosure* cl) :
102103
_satb_qset(satb_qset),
103-
_cl(cl) {}
104+
_cl(cl),
105+
_claim_token(Threads::thread_claim_token()) {}
104106

105107
void do_thread(Thread* thread) {
106-
// Transfer any partial buffer to the qset for completed buffer processing.
107-
_satb_qset.flush_queue(ShenandoahThreadLocalData::satb_mark_queue(thread));
108-
if (thread->is_Java_thread()) {
109-
if (_cl != NULL) {
110-
ResourceMark rm;
111-
thread->oops_do(_cl, NULL);
108+
if (thread->claim_threads_do(true, _claim_token)) {
109+
// Transfer any partial buffer to the qset for completed buffer processing.
110+
_satb_qset.flush_queue(ShenandoahThreadLocalData::satb_mark_queue(thread));
111+
if (thread->is_Java_thread()) {
112+
if (_cl != NULL) {
113+
ResourceMark rm;
114+
thread->oops_do(_cl, NULL);
115+
}
112116
}
113117
}
114118
}
@@ -143,7 +147,7 @@ class ShenandoahFinalMarkingTask : public AbstractGangTask {
143147
ShenandoahMarkRefsClosure mark_cl(q, rp);
144148
ShenandoahSATBAndRemarkThreadsClosure tc(satb_mq_set,
145149
ShenandoahIUBarrier ? &mark_cl : NULL);
146-
Threads::possibly_parallel_threads_do(true /*par*/, &tc);
150+
Threads::threads_do(&tc);
147151
}
148152

149153
_cm->mark_loop(worker_id, _terminator, rp,

0 commit comments

Comments
 (0)