< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page
rev 47862 : imported patch 10.07.open.rebase_20171110.dcubed
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.

*** 1174,1184 **** void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; } bool is_at_poll_safepoint() { return _safepoint_state->is_at_poll_safepoint(); } // JavaThread termination and lifecycle support: void smr_delete(); ! bool on_thread_list() { return _on_thread_list; } void set_on_thread_list() { _on_thread_list = true; } // thread has called JavaThread::exit() or is terminated bool is_exiting() const; // thread is terminated (no longer on the threads list); we compare --- 1174,1184 ---- void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; } bool is_at_poll_safepoint() { return _safepoint_state->is_at_poll_safepoint(); } // JavaThread termination and lifecycle support: void smr_delete(); ! 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 bool is_exiting() const; // thread is terminated (no longer on the threads list); we compare
*** 1185,1195 **** // against the two non-terminated values so that a freed JavaThread // will also be considered terminated. bool check_is_terminated(TerminatedTypes l_terminated) const { return l_terminated != _not_terminated && l_terminated != _thread_exiting; } ! bool is_terminated(); void set_terminated(TerminatedTypes t); // special for Threads::remove() which is static: void set_terminated_value(); void block_if_vm_exited(); --- 1185,1195 ---- // against the two non-terminated values so that a freed JavaThread // will also be considered terminated. bool check_is_terminated(TerminatedTypes l_terminated) const { return l_terminated != _not_terminated && l_terminated != _thread_exiting; } ! bool is_terminated() const; void set_terminated(TerminatedTypes t); // special for Threads::remove() which is static: void set_terminated_value(); void block_if_vm_exited();
*** 2128,2155 **** private: // Safe Memory Reclamation (SMR) support: static Monitor* _smr_delete_lock; // The '_cnt', '_max' and '_times" fields are enabled via // -XX:+EnableThreadSMRStatistics: static uint _smr_delete_lock_wait_cnt; 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; 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; static uint _smr_java_thread_list_max; 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; static ThreadsList* _smr_to_delete_list; static uint _smr_to_delete_list_cnt; static uint _smr_to_delete_list_max; static JavaThread* _thread_list; static int _number_of_threads; static int _number_of_non_daemon_threads; --- 2128,2170 ---- private: // Safe Memory Reclamation (SMR) support: 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; ! // 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); ! // # 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; ! // # 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; static int _number_of_threads; static int _number_of_non_daemon_threads;
*** 2197,2211 **** // locking in order to reduce the traffic on the smr_delete_lock. static bool smr_delete_notify(); 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 inc_smr_tlh_cnt(); ! static void update_smr_tlh_time_max(jint new_value); ! static void add_smr_tlh_times(jint add_value); // Initializes the vm and creates the vm thread static jint create_vm(JavaVMInitArgs* args, bool* canTryAgain); static void convert_vm_init_libraries_to_agents(); static void create_vm_init_libraries(); --- 2212,2226 ---- // locking in order to reduce the traffic on the smr_delete_lock. static bool smr_delete_notify(); 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(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(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); static void convert_vm_init_libraries_to_agents(); static void create_vm_init_libraries();
< prev index next >