I wrote a bunch of code with the Mutex::Unlocker and didn't understand it. (#2150)

This commit is contained in:
Garrett Moon
2016-08-26 14:07:18 -07:00
committed by Adlai Holler
parent 905508e9be
commit e6e5c346de
3 changed files with 14 additions and 8 deletions

View File

@@ -224,15 +224,16 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0};
- (void)setShouldRenderProgressImages:(BOOL)shouldRenderProgressImages
{
ASDN::MutexLocker l(__instanceLock__);
__instanceLock__.lock();
if (shouldRenderProgressImages == _shouldRenderProgressImages) {
__instanceLock__.unlock();
return;
}
_shouldRenderProgressImages = shouldRenderProgressImages;
ASDN::MutexUnlocker u(__instanceLock__);
__instanceLock__.unlock();
[self _updateProgressImageBlockOnDownloaderIfNeeded];
}