--- old/src/hotspot/share/gc/shared/taskqueue.hpp 2018-11-28 13:52:45.505250611 -0500 +++ new/src/hotspot/share/gc/shared/taskqueue.hpp 2018-11-28 13:52:45.237250494 -0500 @@ -447,8 +447,8 @@ #undef TRACESPINNING -class ParallelTaskTerminator: public StackObj { -private: +class ParallelTaskTerminator: public CHeapObj { +protected: uint _n_threads; TaskQueueSetSuper* _queue_set; volatile uint _offered_termination; @@ -481,7 +481,7 @@ // As above, but it also terminates if the should_exit_termination() // method of the terminator parameter returns true. If terminator is // NULL, then it is ignored. - bool offer_termination(TerminatorTerminator* terminator); + virtual bool offer_termination(TerminatorTerminator* terminator); // Reset the terminator, so that it may be reused again. // The caller is responsible for ensuring that this is done @@ -500,6 +500,26 @@ #endif }; +class TaskTerminator : public StackObj { +private: + ParallelTaskTerminator* _terminator; + + // Disable following copy constructors and assignment operator + TaskTerminator(TaskTerminator& o) { } + TaskTerminator(const TaskTerminator& o) { } + TaskTerminator& operator=(TaskTerminator& o) { return *this; } +public: + TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set); + ~TaskTerminator(); + + // Move assignment + TaskTerminator& operator=(const TaskTerminator& o); + + ParallelTaskTerminator* terminator() const { + return _terminator; + } +}; + typedef GenericTaskQueue OopTaskQueue; typedef GenericTaskQueueSet OopTaskQueueSet;