3939
4040@interface AWSExecutor ()
4141
42- @property (nonatomic , copy ) void (^block)(void (^block)());
42+ @property (nonatomic , copy ) void (^block)(void (^block)(void ));
4343
4444@end
4545
@@ -51,7 +51,7 @@ + (instancetype)defaultExecutor {
5151 static AWSExecutor *defaultExecutor = NULL ;
5252 static dispatch_once_t onceToken;
5353 dispatch_once (&onceToken, ^{
54- defaultExecutor = [self executorWithBlock: ^void (void (^block)()) {
54+ defaultExecutor = [self executorWithBlock: ^void (void (^block)(void )) {
5555 // We prefer to run everything possible immediately, so that there is callstack information
5656 // when debugging. However, we don't want the stack to get too deep, so if the remaining stack space
5757 // is less than 10% of the total space, we dispatch to another GCD queue.
@@ -74,7 +74,7 @@ + (instancetype)immediateExecutor {
7474 static AWSExecutor *immediateExecutor = NULL ;
7575 static dispatch_once_t onceToken;
7676 dispatch_once (&onceToken, ^{
77- immediateExecutor = [self executorWithBlock: ^void (void (^block)()) {
77+ immediateExecutor = [self executorWithBlock: ^void (void (^block)(void )) {
7878 block ();
7979 }];
8080 });
@@ -85,7 +85,7 @@ + (instancetype)mainThreadExecutor {
8585 static AWSExecutor *mainThreadExecutor = NULL ;
8686 static dispatch_once_t onceToken;
8787 dispatch_once (&onceToken, ^{
88- mainThreadExecutor = [self executorWithBlock: ^void (void (^block)()) {
88+ mainThreadExecutor = [self executorWithBlock: ^void (void (^block)(void )) {
8989 if (![NSThread isMainThread ]) {
9090 dispatch_async (dispatch_get_main_queue (), block);
9191 } else {
@@ -98,25 +98,25 @@ + (instancetype)mainThreadExecutor {
9898 return mainThreadExecutor;
9999}
100100
101- + (instancetype )executorWithBlock : (void (^)(void (^block)()))block {
101+ + (instancetype )executorWithBlock : (void (^)(void (^block)(void )))block {
102102 return [[self alloc ] initWithBlock: block];
103103}
104104
105105+ (instancetype )executorWithDispatchQueue : (dispatch_queue_t )queue {
106- return [self executorWithBlock: ^void (void (^block)()) {
106+ return [self executorWithBlock: ^void (void (^block)(void )) {
107107 dispatch_async (queue, block);
108108 }];
109109}
110110
111111+ (instancetype )executorWithOperationQueue : (NSOperationQueue *)queue {
112- return [self executorWithBlock: ^void (void (^block)()) {
112+ return [self executorWithBlock: ^void (void (^block)(void )) {
113113 [queue addOperation: [NSBlockOperation blockOperationWithBlock: block]];
114114 }];
115115}
116116
117117#pragma mark - Initializer
118118
119- - (instancetype )initWithBlock : (void (^)(void (^block)()))block {
119+ - (instancetype )initWithBlock : (void (^)(void (^block)(void )))block {
120120 self = [super init ];
121121 if (!self) return self;
122122
@@ -127,7 +127,7 @@ - (instancetype)initWithBlock:(void(^)(void(^block)()))block {
127127
128128#pragma mark - Execution
129129
130- - (void )execute : (void (^)())block {
130+ - (void )execute : (void (^)(void ))block {
131131 self.block (block);
132132}
133133
0 commit comments