changeset 10243:992cdaf21e93

8136854: G1 ConcurrentG1RefineThread::stop delays JVM shutdown for >150ms Summary: Decrease the default wait delay for mark thread initialization to accomodate very short running applications. Reviewed-by: tbenson, mgerdin
author tschatzl
date Wed, 10 Feb 2016 12:08:37 +0100
parents 3b58a1c9a466
children e3e5642da773
files src/share/vm/gc/shared/concurrentGCThread.cpp src/share/vm/gc/shared/concurrentGCThread.hpp src/share/vm/runtime/init.cpp
diffstat 3 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/shared/concurrentGCThread.cpp	Wed Feb 10 12:05:40 2016 +0100
+++ b/src/share/vm/gc/shared/concurrentGCThread.cpp	Wed Feb 10 12:08:37 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -60,7 +60,7 @@
 void ConcurrentGCThread::wait_for_universe_init() {
   MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);
   while (!is_init_completed() && !_should_terminate) {
-    CGC_lock->wait(Mutex::_no_safepoint_check_flag, 200);
+    CGC_lock->wait(Mutex::_no_safepoint_check_flag, 1);
   }
 }
 
--- a/src/share/vm/gc/shared/concurrentGCThread.hpp	Wed Feb 10 12:05:40 2016 +0100
+++ b/src/share/vm/gc/shared/concurrentGCThread.hpp	Wed Feb 10 12:08:37 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -32,7 +32,7 @@
   friend class VMStructs;
 
 protected:
-  bool _should_terminate;
+  bool volatile _should_terminate;
   bool _has_terminated;
 
   // Create and start the thread (setting it's priority high.)
--- a/src/share/vm/runtime/init.cpp	Wed Feb 10 12:05:40 2016 +0100
+++ b/src/share/vm/runtime/init.cpp	Wed Feb 10 12:08:37 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -181,8 +181,7 @@
   }
 }
 
-
-static bool _init_completed = false;
+static volatile bool _init_completed = false;
 
 bool is_init_completed() {
   return _init_completed;