通过 Java源代码 我们有
// variable not written or updated anywhere on this class
private volatile int threadStatus = 0;
public State getState() {
// get current thread state
return sun.misc.VM.toThreadState(threadStatus);
}
如何以及在哪里更新threadStatus
?
我们的想法是最终尝试使用AOP编织更新方法,并在threadStatus
更改时进行回调。