< prev index next >

src/hotspot/share/gc/shared/taskqueue.hpp

Print this page

        

*** 368,377 **** --- 368,379 ---- class TaskQueueSetSuper { 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 <MEMFLAGS F> class TaskQueueSetSuperImpl: public CHeapObj<F>, public TaskQueueSetSuper { };
*** 397,406 **** --- 399,409 ---- // Try to steal a task from some other queue than queue_num. It may perform several attempts at doing so. // Returns if stealing succeeds, and sets "t" to the stolen task. bool steal(uint queue_num, E& t); bool peek(); + uint tasks() const; uint size() const { return _n; } }; template<class T, MEMFLAGS F> void
*** 422,431 **** --- 425,443 ---- return true; } return false; } + template<class T, MEMFLAGS F> + uint GenericTaskQueueSet<T, F>::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<mtInternal> { public: virtual bool should_exit_termination() = 0; };
*** 434,444 **** // TaskQueueSet's for work stealing. #undef TRACESPINNING class ParallelTaskTerminator: public StackObj { ! private: uint _n_threads; TaskQueueSetSuper* _queue_set; volatile uint _offered_termination; #ifdef TRACESPINNING --- 446,456 ---- // TaskQueueSet's for work stealing. #undef TRACESPINNING class ParallelTaskTerminator: public StackObj { ! protected: uint _n_threads; TaskQueueSetSuper* _queue_set; volatile uint _offered_termination; #ifdef TRACESPINNING
< prev index next >