Remove the previous using atomic property, use lock instead.
This commit is contained in:
parent
f9e80d18eb
commit
f060310ffe
|
@ -58,7 +58,7 @@ typedef NS_ENUM(NSUInteger, SDImageCachesManagerOperationPolicy) {
|
|||
/**
|
||||
All caches in caches manager. The caches array is a priority queue, which means the later added cache will have the highest priority
|
||||
*/
|
||||
@property (atomic, copy, readwrite, nullable) NSArray<id<SDImageCache>> *caches;
|
||||
@property (nonatomic, copy, readwrite, nullable) NSArray<id<SDImageCache>> *caches;
|
||||
|
||||
/**
|
||||
Add a new cache to the end of caches array. Which has the highest priority.
|
||||
|
|
|
@ -75,7 +75,9 @@
|
|||
if (!key) {
|
||||
return nil;
|
||||
}
|
||||
NSArray<id<SDImageCache>> *caches = [self.caches copy];
|
||||
SD_LOCK(self.cachesLock);
|
||||
NSArray<id<SDImageCache>> *caches = self.caches;
|
||||
SD_UNLOCK(self.cachesLock);
|
||||
NSUInteger count = caches.count;
|
||||
if (count == 0) {
|
||||
return nil;
|
||||
|
@ -117,7 +119,9 @@
|
|||
if (!key) {
|
||||
return;
|
||||
}
|
||||
NSArray<id<SDImageCache>> *caches = [self.caches copy];
|
||||
SD_LOCK(self.cachesLock);
|
||||
NSArray<id<SDImageCache>> *caches = self.caches;
|
||||
SD_UNLOCK(self.cachesLock);
|
||||
NSUInteger count = caches.count;
|
||||
if (count == 0) {
|
||||
return;
|
||||
|
@ -155,7 +159,9 @@
|
|||
if (!key) {
|
||||
return;
|
||||
}
|
||||
NSArray<id<SDImageCache>> *caches = [self.caches copy];
|
||||
SD_LOCK(self.cachesLock);
|
||||
NSArray<id<SDImageCache>> *caches = self.caches;
|
||||
SD_UNLOCK(self.cachesLock);
|
||||
NSUInteger count = caches.count;
|
||||
if (count == 0) {
|
||||
return;
|
||||
|
@ -193,7 +199,9 @@
|
|||
if (!key) {
|
||||
return;
|
||||
}
|
||||
NSArray<id<SDImageCache>> *caches = [self.caches copy];
|
||||
SD_LOCK(self.cachesLock);
|
||||
NSArray<id<SDImageCache>> *caches = self.caches;
|
||||
SD_UNLOCK(self.cachesLock);
|
||||
NSUInteger count = caches.count;
|
||||
if (count == 0) {
|
||||
return;
|
||||
|
@ -230,7 +238,9 @@
|
|||
}
|
||||
|
||||
- (void)clearWithCacheType:(SDImageCacheType)cacheType completion:(SDWebImageNoParamsBlock)completionBlock {
|
||||
NSArray<id<SDImageCache>> *caches = [self.caches copy];
|
||||
SD_LOCK(self.cachesLock);
|
||||
NSArray<id<SDImageCache>> *caches = self.caches;
|
||||
SD_UNLOCK(self.cachesLock);
|
||||
NSUInteger count = caches.count;
|
||||
if (count == 0) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue