Это нормально? Synchronized (thread), затем thread = null в блоке synch

Я вижу это:

// 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-кода.

5
задан bobobobo 19 November 2010 в 16:04
поделиться