我看到这个:
// thread is a member of this class
synchronized( this.thread )
{
this.thread.running = false;
this.thread.notifyAll(); // Wake up anything that was .waiting() on
// the thread
this.thread = null; // kill this thread reference.
// can you do that in a synchronized block?
}
可以设置thread=null
同时保持锁定吗?
我在一些 BB 代码中找到了这个金块。