equal
deleted
inserted
replaced
950 // ------------------------------------------------------------------------------------------------------- |
950 // ------------------------------------------------------------------------------------------------------- |
951 // Implementation of ThreadSafepointState |
951 // Implementation of ThreadSafepointState |
952 |
952 |
953 ThreadSafepointState::ThreadSafepointState(JavaThread *thread) |
953 ThreadSafepointState::ThreadSafepointState(JavaThread *thread) |
954 : _at_poll_safepoint(false), _thread(thread), _safepoint_safe(false), |
954 : _at_poll_safepoint(false), _thread(thread), _safepoint_safe(false), |
955 _safepoint_id(SafepointSynchronize::InactiveSafepointCounter), |
955 _safepoint_id(SafepointSynchronize::InactiveSafepointCounter), _next(NULL) { |
956 _orig_thread_state(_thread_uninitialized), _next(NULL) { |
|
957 } |
956 } |
958 |
957 |
959 void ThreadSafepointState::create(JavaThread *thread) { |
958 void ThreadSafepointState::create(JavaThread *thread) { |
960 ThreadSafepointState *state = new ThreadSafepointState(thread); |
959 ThreadSafepointState *state = new ThreadSafepointState(thread); |
961 thread->set_safepoint_state(state); |
960 thread->set_safepoint_state(state); |
987 if (!SafepointSynchronize::try_stable_load_state(&stable_state, _thread, safepoint_count)) { |
986 if (!SafepointSynchronize::try_stable_load_state(&stable_state, _thread, safepoint_count)) { |
988 // We could not get stable state of the JavaThread. |
987 // We could not get stable state of the JavaThread. |
989 // Consider it running and just return. |
988 // Consider it running and just return. |
990 return; |
989 return; |
991 } |
990 } |
992 |
|
993 // Save the state at the start of safepoint processing. |
|
994 _orig_thread_state = stable_state; |
|
995 |
991 |
996 // Check for a thread that is suspended. Note that thread resume tries |
992 // Check for a thread that is suspended. Note that thread resume tries |
997 // to grab the Threads_lock which we own here, so a thread cannot be |
993 // to grab the Threads_lock which we own here, so a thread cannot be |
998 // resumed during safepoint synchronization. |
994 // resumed during safepoint synchronization. |
999 |
995 |
1058 p2i(_thread), _thread->osthread()->thread_id(), s, _at_poll_safepoint); |
1054 p2i(_thread), _thread->osthread()->thread_id(), s, _at_poll_safepoint); |
1059 |
1055 |
1060 _thread->print_thread_state_on(st); |
1056 _thread->print_thread_state_on(st); |
1061 } |
1057 } |
1062 |
1058 |
1063 void ThreadSafepointState::print() const { print_on(tty); } |
|
1064 |
|
1065 // --------------------------------------------------------------------------------------------------------------------- |
1059 // --------------------------------------------------------------------------------------------------------------------- |
1066 |
1060 |
1067 // Block the thread at poll or poll return for safepoint/handshake. |
1061 // Block the thread at poll or poll return for safepoint/handshake. |
1068 void ThreadSafepointState::handle_polling_page_exception() { |
1062 void ThreadSafepointState::handle_polling_page_exception() { |
1069 |
1063 |