--- old/src/hotspot/share/runtime/thread.hpp Tue Nov 21 15:20:41 2017 +++ new/src/hotspot/share/runtime/thread.hpp Tue Nov 21 15:20:40 2017 @@ -1176,7 +1176,7 @@ // JavaThread termination and lifecycle support: void smr_delete(); - bool on_thread_list() { return _on_thread_list; } + bool on_thread_list() const { return _on_thread_list; } void set_on_thread_list() { _on_thread_list = true; } // thread has called JavaThread::exit() or is terminated @@ -1187,7 +1187,7 @@ bool check_is_terminated(TerminatedTypes l_terminated) const { return l_terminated != _not_terminated && l_terminated != _thread_exiting; } - bool is_terminated(); + bool is_terminated() const; void set_terminated(TerminatedTypes t); // special for Threads::remove() which is static: void set_terminated_value(); @@ -2130,24 +2130,39 @@ static Monitor* _smr_delete_lock; // The '_cnt', '_max' and '_times" fields are enabled via // -XX:+EnableThreadSMRStatistics: + // # of parallel threads in _smr_delete_lock->wait(). static uint _smr_delete_lock_wait_cnt; + // Max # of parallel threads in _smr_delete_lock->wait(). static uint _smr_delete_lock_wait_max; - static volatile jint _smr_delete_notify; - static volatile jint _smr_deleted_thread_cnt; - static volatile jint _smr_deleted_thread_time_max; - static volatile jint _smr_deleted_thread_times; + // Flag to indicate when an _smr_delete_lock->notify() is needed. + static volatile uint _smr_delete_notify; + // # of threads deleted over VM lifetime. + static volatile uint _smr_deleted_thread_cnt; + // Max time in millis to delete a thread. + static volatile uint _smr_deleted_thread_time_max; + // Cumulative time in millis to delete threads. + static volatile uint _smr_deleted_thread_times; static ThreadsList* volatile _smr_java_thread_list; static ThreadsList* get_smr_java_thread_list(); static ThreadsList* xchg_smr_java_thread_list(ThreadsList* new_list); - static long _smr_java_thread_list_alloc_cnt; - static long _smr_java_thread_list_free_cnt; + // # of ThreadsLists allocated over VM lifetime. + static uint64_t _smr_java_thread_list_alloc_cnt; + // # of ThreadsLists freed over VM lifetime. + static uint64_t _smr_java_thread_list_free_cnt; + // Max size ThreadsList allocated. static uint _smr_java_thread_list_max; + // Max # of nested ThreadsLists for a thread. static uint _smr_nested_thread_list_max; - static volatile jint _smr_tlh_cnt; - static volatile jint _smr_tlh_time_max; - static volatile jint _smr_tlh_times; + // # of ThreadsListHandles deleted over VM lifetime. + static volatile uint _smr_tlh_cnt; + // Max time in millis to delete a ThreadsListHandle. + static volatile uint _smr_tlh_time_max; + // Cumulative time in millis to delete ThreadsListHandles. + static volatile uint _smr_tlh_times; static ThreadsList* _smr_to_delete_list; + // # of parallel ThreadsLists on the to-delete list. static uint _smr_to_delete_list_cnt; + // Max # of parallel ThreadsLists on the to-delete list. static uint _smr_to_delete_list_max; static JavaThread* _thread_list; @@ -2199,11 +2214,11 @@ static void set_smr_delete_notify(); static void clear_smr_delete_notify(); static void inc_smr_deleted_thread_cnt(); - static void update_smr_deleted_thread_time_max(jint new_value); - static void add_smr_deleted_thread_times(jint add_value); + static void update_smr_deleted_thread_time_max(uint new_value); + static void add_smr_deleted_thread_times(uint add_value); static void inc_smr_tlh_cnt(); - static void update_smr_tlh_time_max(jint new_value); - static void add_smr_tlh_times(jint add_value); + static void update_smr_tlh_time_max(uint new_value); + static void add_smr_tlh_times(uint add_value); // Initializes the vm and creates the vm thread static jint create_vm(JavaVMInitArgs* args, bool* canTryAgain);