< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page
rev 47862 : imported patch 10.07.open.rebase_20171110.dcubed
rev 47863 : imported patch 10.08.open.rebase_20171114.rehn
rev 47864 : imported patch 10.09.open.TLH_hang_fix.rehn
rev 47865 : dholmes CR: Fix indents, trailing spaces and various typos. Add descriptions for the '_cnt', '_max' and '_times" fields, add impl notes to document the type choices.
rev 47866 : robinw CR: Fix some inefficient code, update some comments, fix some indents, and add some 'const' specifiers.

@@ -3427,14 +3427,19 @@
 
 
 // ======= Threads ========
 
 // The Threads class links together all active threads, and provides
-// operations over all threads.  It is protected by its own Mutex
-// lock, which is also used in other contexts to protect thread
-// operations from having the thread being operated on from exiting
-// and going away unexpectedly (e.g., safepoint synchronization)
+// operations over all threads. It is protected by the Threads_lock,
+// which is also used in other global contexts like safepointing.
+// ThreadsListHandles are used to safely perform operations on one
+// or more threads without the risk of the thread exiting during the
+// operation.
+//
+// Note: The Threads_lock is currently more widely used than we
+// would like. We are actively migrating Threads_lock uses to other
+// mechanisms in order to reduce Threads_lock contention.
 
 JavaThread*           Threads::_thread_list = NULL;
 int                   Threads::_number_of_threads = 0;
 int                   Threads::_number_of_non_daemon_threads = 0;
 int                   Threads::_return_code = 0;

@@ -4889,12 +4894,12 @@
     Threads::clear_smr_delete_notify();
     Threads::smr_delete_lock()->unlock();
     // Retry the whole scenario.
   }
 
-  // If someone set a handshake on us just as we entered exit path, we simple cancel it.
   if (ThreadLocalHandshakes) {
+    // The thread is about to be deleted so cancel any handshake.
     thread->cancel_handshake();
   }
 
   delete thread;
   if (EnableThreadSMRStatistics) {
< prev index next >