8191864: Provide a public destructor for WorkGang

Reviewed-by: stefank, sjohanss
This commit is contained in:
Per Lidén 2017-11-27 13:50:03 +01:00
parent 1e7b0b326d
commit bfc0314e87
2 changed files with 8 additions and 3 deletions

View File

@ -261,6 +261,10 @@ WorkGang::WorkGang(const char* name,
_dispatcher(create_dispatcher())
{ }
WorkGang::~WorkGang() {
delete _dispatcher;
}
AbstractGangWorker* WorkGang::allocate_worker(uint worker_id) {
return new GangWorker(this, worker_id);
}

View File

@ -122,6 +122,8 @@ class AbstractWorkGang : public CHeapObj<mtInternal> {
// Printing support.
const char* _name;
~AbstractWorkGang() {}
private:
// Initialize only instance data.
const bool _are_GC_task_threads;
@ -206,9 +208,6 @@ class WorkGang: public AbstractWorkGang {
// To get access to the GangTaskDispatcher instance.
friend class GangWorker;
// Never deleted.
~WorkGang();
GangTaskDispatcher* const _dispatcher;
GangTaskDispatcher* dispatcher() const {
return _dispatcher;
@ -220,6 +219,8 @@ public:
bool are_GC_task_threads,
bool are_ConcurrentGC_threads);
~WorkGang();
// Run a task using the current active number of workers, returns when the task is done.
virtual void run_task(AbstractGangTask* task);
// Run a task with the given number of workers, returns