241 set_last_handle_mark(NULL); |
241 set_last_handle_mark(NULL); |
242 |
242 |
243 // This initial value ==> never claimed. |
243 // This initial value ==> never claimed. |
244 _oops_do_parity = 0; |
244 _oops_do_parity = 0; |
245 _threads_hazard_ptr = NULL; |
245 _threads_hazard_ptr = NULL; |
246 _nested_threads_hazard_ptr = NULL; |
246 _threads_list_ptr = NULL; |
247 _nested_threads_hazard_ptr_cnt = 0; |
247 _nested_threads_hazard_ptr_cnt = 0; |
248 _rcu_counter = 0; |
248 _rcu_counter = 0; |
249 |
249 |
250 // the handle mark links itself to last_handle_mark |
250 // the handle mark links itself to last_handle_mark |
251 new HandleMark(this); |
251 new HandleMark(this); |
879 st->print("os_prio=%d ", os_prio); |
879 st->print("os_prio=%d ", os_prio); |
880 } |
880 } |
881 st->print("tid=" INTPTR_FORMAT " ", p2i(this)); |
881 st->print("tid=" INTPTR_FORMAT " ", p2i(this)); |
882 osthread()->print_on(st); |
882 osthread()->print_on(st); |
883 } |
883 } |
884 if (_threads_hazard_ptr != NULL) { |
884 ThreadsSMRSupport::print_info_on(this, st); |
885 st->print("_threads_hazard_ptr=" INTPTR_FORMAT, p2i(_threads_hazard_ptr)); |
|
886 } |
|
887 if (_nested_threads_hazard_ptr != NULL) { |
|
888 print_nested_threads_hazard_ptrs_on(st); |
|
889 } |
|
890 st->print(" "); |
885 st->print(" "); |
891 debug_only(if (WizardMode) print_owned_locks_on(st);) |
886 debug_only(if (WizardMode) print_owned_locks_on(st);) |
892 } |
|
893 |
|
894 void Thread::print_nested_threads_hazard_ptrs_on(outputStream* st) const { |
|
895 assert(_nested_threads_hazard_ptr != NULL, "must be set to print"); |
|
896 |
|
897 if (EnableThreadSMRStatistics) { |
|
898 st->print(", _nested_threads_hazard_ptr_cnt=%u", _nested_threads_hazard_ptr_cnt); |
|
899 } |
|
900 st->print(", _nested_threads_hazard_ptrs="); |
|
901 for (NestedThreadsList* node = _nested_threads_hazard_ptr; node != NULL; |
|
902 node = node->next()) { |
|
903 if (node != _nested_threads_hazard_ptr) { |
|
904 // First node does not need a comma-space separator. |
|
905 st->print(", "); |
|
906 } |
|
907 st->print(INTPTR_FORMAT, p2i(node->t_list())); |
|
908 } |
|
909 } |
887 } |
910 |
888 |
911 // Thread::print_on_error() is called by fatal error handler. Don't use |
889 // Thread::print_on_error() is called by fatal error handler. Don't use |
912 // any lock or allocate memory. |
890 // any lock or allocate memory. |
913 void Thread::print_on_error(outputStream* st, char* buf, int buflen) const { |
891 void Thread::print_on_error(outputStream* st, char* buf, int buflen) const { |
928 |
906 |
929 if (osthread()) { |
907 if (osthread()) { |
930 st->print(" [id=%d]", osthread()->thread_id()); |
908 st->print(" [id=%d]", osthread()->thread_id()); |
931 } |
909 } |
932 |
910 |
933 if (_threads_hazard_ptr != NULL) { |
911 ThreadsSMRSupport::print_info_on(this, st); |
934 st->print(" _threads_hazard_ptr=" INTPTR_FORMAT, p2i(_threads_hazard_ptr)); |
|
935 } |
|
936 if (_nested_threads_hazard_ptr != NULL) { |
|
937 print_nested_threads_hazard_ptrs_on(st); |
|
938 } |
|
939 } |
912 } |
940 |
913 |
941 void Thread::print_value_on(outputStream* st) const { |
914 void Thread::print_value_on(outputStream* st) const { |
942 if (is_Named_thread()) { |
915 if (is_Named_thread()) { |
943 st->print(" \"%s\" ", name()); |
916 st->print(" \"%s\" ", name()); |
2993 } |
2966 } |
2994 st->print(", stack(" PTR_FORMAT "," PTR_FORMAT ")", |
2967 st->print(", stack(" PTR_FORMAT "," PTR_FORMAT ")", |
2995 p2i(stack_end()), p2i(stack_base())); |
2968 p2i(stack_end()), p2i(stack_base())); |
2996 st->print("]"); |
2969 st->print("]"); |
2997 |
2970 |
2998 if (_threads_hazard_ptr != NULL) { |
2971 ThreadsSMRSupport::print_info_on(this, st); |
2999 st->print(" _threads_hazard_ptr=" INTPTR_FORMAT, p2i(_threads_hazard_ptr)); |
|
3000 } |
|
3001 if (_nested_threads_hazard_ptr != NULL) { |
|
3002 print_nested_threads_hazard_ptrs_on(st); |
|
3003 } |
|
3004 return; |
2972 return; |
3005 } |
2973 } |
3006 |
2974 |
3007 // Verification |
2975 // Verification |
3008 |
2976 |