मैं यह देखने में सिंक्रनाइज़ (धागा), तो सूत्र = बातिल:क्या यह ठीक है? सिंक ब्लॉक
// 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
स्थापित करने के लिए, जबकि अभी भी उस पर एक ताला रखते हुए ठीक है?
मुझे यह बीबी कोड में थोड़ा सा पता चला।
क्या कोई कारण है कि आप Thread.interrupt() का उपयोग नहीं कर रहे हैं क्योंकि यह अंतर्निहित पुस्तकालयों द्वारा समर्थित है? –