File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 12
12
13
13
@interface QNNQue ()
14
14
15
- +(instancetype )sharedInstance ;
15
+ + (instancetype )sharedInstance ;
16
16
17
17
@property (nonatomic ) dispatch_queue_t que;
18
18
19
19
@end
20
20
21
21
@implementation QNNQue
22
22
23
- +(instancetype )sharedInstance {
23
+ + (instancetype )sharedInstance {
24
24
static QNNQue *sharedInstance = nil ;
25
-
25
+
26
26
static dispatch_once_t onceToken;
27
27
dispatch_once (&onceToken, ^{
28
28
sharedInstance = [[self alloc ] init ];
29
29
});
30
-
30
+
31
31
return sharedInstance;
32
32
}
33
- -(instancetype )init {
33
+ - (instancetype )init {
34
34
if (self = [super init ]) {
35
35
_que = dispatch_queue_create (" qnn_que_serial" , DISPATCH_QUEUE_SERIAL);
36
36
}
37
37
return self;
38
38
}
39
39
40
- + (void )async_run_serial : (dispatch_block_t )block {
40
+ + (void )async_run_serial : (dispatch_block_t )block {
41
41
dispatch_async ([QNNQue sharedInstance ].que , ^{
42
42
block ();
43
43
});
44
44
}
45
45
46
- + (void )async_run_main : (dispatch_block_t )block {
46
+ + (void )async_run_main : (dispatch_block_t )block {
47
47
dispatch_async (dispatch_get_main_queue (), block);
48
48
}
49
49
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ - (void)run {
190
190
if (-1 == fcntl (recv_sock, F_SETFL, O_NONBLOCK)) {
191
191
NSLog (@" fcntl socket error!" );
192
192
if (_complete != nil ) {
193
- [QNNQue async_run_main: ^(void ) {
193
+ [QNNQue async_run_main: ^(void ) {
194
194
QNNTraceRouteResult* result = [[QNNTraceRouteResult alloc ] init: -1 ip: [NSString stringWithUTF8String: inet_ntoa (addr.sin_addr)] content: nil ];
195
195
_complete (result);
196
196
}];
You can’t perform that action at this time.
0 commit comments