117 // Cumulative time in millis to delete ThreadsListHandles.
118 // Impl note: Atomically added to over VM lifetime so use unsigned for more
119 // range. Unsigned 64-bit would be more future proof, but 64-bit atomic inc
120 // isn't available everywhere (or is it?).
121 volatile uint ThreadsSMRSupport::_tlh_times = 0;
122
123 ThreadsList* ThreadsSMRSupport::_to_delete_list = NULL;
124
125 // # of parallel ThreadsLists on the to-delete list.
126 // Impl note: Hard to imagine > 64K ThreadsLists needing to be deleted so
127 // this could be 16-bit, but there is no nice 16-bit _FORMAT support.
128 uint ThreadsSMRSupport::_to_delete_list_cnt = 0;
129
130 // Max # of parallel ThreadsLists on the to-delete list.
131 // Impl note: See _to_delete_list_cnt note.
132 uint ThreadsSMRSupport::_to_delete_list_max = 0;
133
134 // 'inline' functions first so the definitions are before first use:
135
136 inline void ThreadsSMRSupport::add_deleted_thread_times(uint add_value) {
137 Atomic::add(add_value, &_deleted_thread_times);
138 }
139
140 inline void ThreadsSMRSupport::inc_deleted_thread_cnt() {
141 Atomic::inc(&_deleted_thread_cnt);
142 }
143
144 inline void ThreadsSMRSupport::inc_java_thread_list_alloc_cnt() {
145 _java_thread_list_alloc_cnt++;
146 }
147
148 inline bool ThreadsSMRSupport::is_bootstrap_list(ThreadsList* list) {
149 return list == &_bootstrap_list;
150 }
151
152 inline void ThreadsSMRSupport::update_deleted_thread_time_max(uint new_value) {
153 while (true) {
154 uint cur_value = _deleted_thread_time_max;
155 if (new_value <= cur_value) {
156 // No need to update max value so we're done.
157 break;
|
117 // Cumulative time in millis to delete ThreadsListHandles.
118 // Impl note: Atomically added to over VM lifetime so use unsigned for more
119 // range. Unsigned 64-bit would be more future proof, but 64-bit atomic inc
120 // isn't available everywhere (or is it?).
121 volatile uint ThreadsSMRSupport::_tlh_times = 0;
122
123 ThreadsList* ThreadsSMRSupport::_to_delete_list = NULL;
124
125 // # of parallel ThreadsLists on the to-delete list.
126 // Impl note: Hard to imagine > 64K ThreadsLists needing to be deleted so
127 // this could be 16-bit, but there is no nice 16-bit _FORMAT support.
128 uint ThreadsSMRSupport::_to_delete_list_cnt = 0;
129
130 // Max # of parallel ThreadsLists on the to-delete list.
131 // Impl note: See _to_delete_list_cnt note.
132 uint ThreadsSMRSupport::_to_delete_list_max = 0;
133
134 // 'inline' functions first so the definitions are before first use:
135
136 inline void ThreadsSMRSupport::add_deleted_thread_times(uint add_value) {
137 Atomic::add(&_deleted_thread_times, add_value);
138 }
139
140 inline void ThreadsSMRSupport::inc_deleted_thread_cnt() {
141 Atomic::inc(&_deleted_thread_cnt);
142 }
143
144 inline void ThreadsSMRSupport::inc_java_thread_list_alloc_cnt() {
145 _java_thread_list_alloc_cnt++;
146 }
147
148 inline bool ThreadsSMRSupport::is_bootstrap_list(ThreadsList* list) {
149 return list == &_bootstrap_list;
150 }
151
152 inline void ThreadsSMRSupport::update_deleted_thread_time_max(uint new_value) {
153 while (true) {
154 uint cur_value = _deleted_thread_time_max;
155 if (new_value <= cur_value) {
156 // No need to update max value so we're done.
157 break;
|