【发布时间】:2010-11-19 16:04:55
【问题描述】:
我看到了:
// 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() 因为底层库支持?
标签: java blackberry synchronized-block