The JavaThread::_terminated field exists for tracking a JavaThread's
journey thru the thread exit process. The detaching of the GC barrier
from a JavaThread during the exit process is turning out to be an
important state change that needs visibility in order to have correctly
functioning code. Adding JavaThread::is_oop_safe() and
the necessary associated infrastructure provides this visibility.
This comment change from class JavaThread:
@@ -914,7 +915,7 @@ class JavaThread: public Thread {
private:
// In general a JavaThread's _terminated field transitions as follows:
//
- // _not_terminated => _thread_exiting => _thread_terminated
+ // _not_terminated => _thread_exiting => _thread_gc_barrier_detached => _thread_terminated
shows where the new _thread_gc_barrier_detached value
fits into the _terminated field transitions.