--- old/src/hotspot/share/gc/shared/taskqueue.hpp 2018-10-15 08:57:57.430171201 -0400 +++ new/src/hotspot/share/gc/shared/taskqueue.hpp 2018-10-15 08:57:57.135170585 -0400 @@ -370,6 +370,8 @@ public: // Returns "true" if some TaskQueue in the set contains a task. virtual bool peek() = 0; + // Tasks in queue + virtual uint tasks() const = 0; }; template class TaskQueueSetSuperImpl: public CHeapObj, public TaskQueueSetSuper { @@ -399,6 +401,7 @@ bool steal(uint queue_num, E& t); bool peek(); + uint tasks() const; uint size() const { return _n; } }; @@ -424,6 +427,15 @@ return false; } +template +uint GenericTaskQueueSet::tasks() const { + uint n = 0; + for (uint j = 0; j < _n; j++) { + n += _queues[j]->size(); + } + return n; +} + // When to terminate from the termination protocol. class TerminatorTerminator: public CHeapObj { public: