내가 이것을 볼 싱크 블록 = (스레드), 다음 스레드 널 동기화 :괜찮습니까?
// 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 코드에서이 너겟을 발견했습니다.
기본 라이브러리에서 Thread.interrupt()를 사용하지 않는 이유가 있습니까? –