changeset 47998:f93055f440d8

8191864: Provide a public destructor for WorkGang Reviewed-by: stefank, sjohanss
author pliden
date Mon, 27 Nov 2017 13:50:03 +0100
parents 37937ce6adf3
children f140bebf0348
files src/hotspot/share/gc/shared/workgroup.cpp src/hotspot/share/gc/shared/workgroup.hpp
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shared/workgroup.cpp	Mon Nov 27 13:34:00 2017 +0100
+++ b/src/hotspot/share/gc/shared/workgroup.cpp	Mon Nov 27 13:50:03 2017 +0100
@@ -261,6 +261,10 @@
     _dispatcher(create_dispatcher())
 { }
 
+WorkGang::~WorkGang() {
+  delete _dispatcher;
+}
+
 AbstractGangWorker* WorkGang::allocate_worker(uint worker_id) {
   return new GangWorker(this, worker_id);
 }
--- a/src/hotspot/share/gc/shared/workgroup.hpp	Mon Nov 27 13:34:00 2017 +0100
+++ b/src/hotspot/share/gc/shared/workgroup.hpp	Mon Nov 27 13:50:03 2017 +0100
@@ -122,6 +122,8 @@
   // Printing support.
   const char* _name;
 
+  ~AbstractWorkGang() {}
+
  private:
   // Initialize only instance data.
   const bool _are_GC_task_threads;
@@ -206,9 +208,6 @@
   // 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 @@
            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