I'm reading a code with this class:
public class MultiThreadedServer implements Runnable {
// some more code
protected Thread runningThread = null;
public void run() {
synchronized(this) {
this.runningThread = Thread.currentThread();
}
// lots of code
}
}
What is this supposed to mean ? The thread itself is used as flag to lock the ressource ? I don't get it at all.
Anyone knows ?