mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-06 04:32:06 +00:00
Make shared CA transaction queue variable extern so it's actually shared (#1397)
This commit is contained in:
parent
5490d4d1fa
commit
abe46b08a9
@ -68,13 +68,14 @@ AS_SUBCLASSING_RESTRICTED
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
extern ASCATransactionQueue *_ASSharedCATransactionQueue;
|
||||||
|
extern dispatch_once_t _ASSharedCATransactionQueueOnceToken;
|
||||||
|
|
||||||
NS_INLINE ASCATransactionQueue *ASCATransactionQueueGet(void) {
|
NS_INLINE ASCATransactionQueue *ASCATransactionQueueGet(void) {
|
||||||
static ASCATransactionQueue *q;
|
dispatch_once(&_ASSharedCATransactionQueueOnceToken, ^{
|
||||||
static dispatch_once_t onceToken;
|
_ASSharedCATransactionQueue = [[ASCATransactionQueue alloc] init];
|
||||||
dispatch_once(&onceToken, ^{
|
|
||||||
q = [[ASCATransactionQueue alloc] init];
|
|
||||||
});
|
});
|
||||||
return q;
|
return _ASSharedCATransactionQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface ASDeallocQueue : NSObject
|
@interface ASDeallocQueue : NSObject
|
||||||
|
@ -354,6 +354,9 @@ ASSynthesizeLockingMethodsWithMutex(_internalQueueLock)
|
|||||||
// but after most other scheduled work on the runloop has processed.
|
// but after most other scheduled work on the runloop has processed.
|
||||||
static int const kASASCATransactionQueueOrder = 1000000;
|
static int const kASASCATransactionQueueOrder = 1000000;
|
||||||
|
|
||||||
|
ASCATransactionQueue *_ASSharedCATransactionQueue;
|
||||||
|
dispatch_once_t _ASSharedCATransactionQueueOnceToken;
|
||||||
|
|
||||||
- (instancetype)init
|
- (instancetype)init
|
||||||
{
|
{
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user