このコードのスニペットと混同しています:
void stopTestThread() {
// thread should cooperatively shutdown on the next iteration, because field is now null
Thread testThread = m_logTestThread;
m_logTestThread = null;
if (testThread != null) {
testThread.interrupt();
try {testThread.join();} catch (InterruptedException e) {}
}
}
これは、testThreadとm_logTestThreadが異なるインスタンスであるが、メモリ内の同じオブジェクトを指しているため、同じスレッドであることを意味しますか?
もしそうなら、目的は何if (testThread != null)
ですか?