8216072: Remove TaskTerminator's assignment operator
authorzgu
Thu, 31 Jan 2019 10:18:41 -0500
changeset 53586 5bc1634bc0ca
parent 53585 5e9f3a73abab
child 53587 739eaf4ac4ad
8216072: Remove TaskTerminator's assignment operator Reviewed-by: tschatzl, rkennke, kbarrett
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
src/hotspot/share/gc/shared/taskqueue.cpp
src/hotspot/share/gc/shared/taskqueue.hpp
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Thu Jan 31 10:05:11 2019 -0500
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Thu Jan 31 10:18:41 2019 -0500
@@ -588,7 +588,7 @@
   _num_active_tasks = active_tasks;
   // Need to update the three data structures below according to the
   // number of active threads for this phase.
-  _terminator = TaskTerminator((int) active_tasks, _task_queues);
+  _terminator.terminator()->reset_for_reuse((int) active_tasks);
   _first_overflow_barrier_sync.set_n_workers((int) active_tasks);
   _second_overflow_barrier_sync.set_n_workers((int) active_tasks);
 }
--- a/src/hotspot/share/gc/shared/taskqueue.cpp	Thu Jan 31 10:05:11 2019 -0500
+++ b/src/hotspot/share/gc/shared/taskqueue.cpp	Thu Jan 31 10:18:41 2019 -0500
@@ -281,13 +281,3 @@
   }
 }
 
-// Move assignment
-TaskTerminator& TaskTerminator::operator=(const TaskTerminator& o) {
-  if (_terminator != NULL) {
-    delete _terminator;
-  }
-  _terminator = o.terminator();
-  const_cast<TaskTerminator&>(o)._terminator = NULL;
-  return *this;
-}
-
--- a/src/hotspot/share/gc/shared/taskqueue.hpp	Thu Jan 31 10:05:11 2019 -0500
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp	Thu Jan 31 10:18:41 2019 -0500
@@ -510,37 +510,21 @@
 #endif
 };
 
-#ifdef _MSC_VER
-#pragma warning(push)
-// warning C4521: multiple copy constructors specified
-#pragma warning(disable:4521)
-// warning C4522: multiple assignment operators specified
-#pragma warning(disable:4522)
-#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; }
+  // Noncopyable.
+  TaskTerminator(const TaskTerminator&);
+  TaskTerminator& operator=(const TaskTerminator&);
 public:
   TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set);
   ~TaskTerminator();
 
-  // Move assignment
-  TaskTerminator& operator=(const TaskTerminator& o);
-
   ParallelTaskTerminator* terminator() const {
     return _terminator;
   }
 };
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
 
 typedef GenericTaskQueue<oop, mtGC>             OopTaskQueue;
 typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;