मेरे पास दो GCD
ब्लॉक हैं जो एसिंक हैं। पहला पृष्ठभूमि धागा के लिए है, मुख्य धागे पर दूसरा रन। यह बहुत अच्छा काम करता है, लेकिन मैंने अभी कहीं बात की है कि मुझे dispatch_release()
का उपयोग करके उन्हें रिलीज़ करने की आवश्यकता हो सकती है। उदा .:dispatch_queue_t dispatch_release() का उपयोग करके रिलीज़ होने की आवश्यकता है?
// Use gcd
dispatch_queue_t queue = dispatch_queue_create("com.awesome", 0);
dispatch_queue_t main = dispatch_get_main_queue();
// do the long running work in bg async queue
// within that, call to update UI on main thread.
dispatch_async(queue, ^{
// Do work in the background
// Release
dispatch_release(queue);
dispatch_async(main, ^{
// Main
// Release
dispatch_release(main);
});//end
});//end
क्या यह सच है? क्या मुझे उन्हें यहां छोड़ने की ज़रूरत है?
हेडर फ़ाइल में टिप्पणियों के अनुसार आपको अपनी कतार पर dispatch_release() को आमंत्रित करने की आवश्यकता है। – BonanzaDriver