< prev index next >

src/share/vm/gc/g1/g1StringDedupThread.cpp

Print this page
rev 10389 : imported patch webrev.01
rev 10391 : [mq]: webrev.03

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -79,26 +79,24 @@
 void G1StringDedupThread::deduplicate_shared_strings(G1StringDedupStat& stat) {
   G1StringDedupSharedClosure sharedStringDedup(stat);
   StringTable::shared_oops_do(&sharedStringDedup);
 }
 
-void G1StringDedupThread::run() {
+void G1StringDedupThread::run_service() {
   G1StringDedupStat total_stat;
 
-  initialize_in_thread();
-  wait_for_universe_init();
   deduplicate_shared_strings(total_stat);
 
   // Main loop
   for (;;) {
     G1StringDedupStat stat;
 
     stat.mark_idle();
 
     // Wait for the queue to become non-empty
     G1StringDedupQueue::wait();
-    if (_should_terminate) {
+    if (should_terminate()) {
       break;
     }
 
     {
       // Include thread in safepoints

@@ -131,27 +129,14 @@
       total_stat.add(stat);
       print(stat, total_stat);
     }
   }
 
-  terminate();
 }
 
-void G1StringDedupThread::stop() {
-  {
-    MonitorLockerEx ml(Terminator_lock);
-    _thread->_should_terminate = true;
-  }
-
+void G1StringDedupThread::stop_service() {
   G1StringDedupQueue::cancel_wait();
-
-  {
-    MonitorLockerEx ml(Terminator_lock);
-    while (!_thread->_has_terminated) {
-      ml.wait();
-    }
-  }
 }
 
 void G1StringDedupThread::print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) {
   if (log_is_enabled(Info, gc, stringdedup)) {
     G1StringDedupStat::print_summary(last_stat, total_stat);
< prev index next >