<分区>
我正在阅读这个类的代码:
public class MultiThreadedServer implements Runnable {
// some more code
protected Thread runningThread = null;
public void run() {
synchronized(this) {
this.runningThread = Thread.currentThread();
}
// lots of code
}
}
这是什么意思?线程本身用作锁定资源的标志?我完全不明白。
有人知道吗?