vedo questo:Va bene? Sincronizzato (thread), quindi infilare = null nel blocco sincronia
// 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?
}
E 'ok per impostare il thread=null
pur mantenendo un blocco su di esso?
Ho trovato questo nugget in un po 'di codice BB.
C'è qualche ragione per cui non si utilizza Thread.interrupt() poiché questo è supportato dalle librerie sottostanti? –