Skip to content

Commit

Permalink
refactor(co_queue.m): remove unuseable code
Browse files Browse the repository at this point in the history
remove some test codes

fix alibaba#14
  • Loading branch information
pengyutang125 committed Mar 1, 2019
1 parent 321d674 commit 7ae3a79
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions coobjc/util/co_queue.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
#import <pthread/pthread.h>
#import <mach/mach.h>

typedef struct coobjc_test_thread_s {
void* queue;
} coobjc_test_thread_s;

dispatch_queue_t co_get_current_queue() {
if ([NSThread isMainThread]) {
return dispatch_get_main_queue();
Expand All @@ -37,10 +33,9 @@ dispatch_queue_t co_get_current_queue() {
if (tiid.dispatch_qaddr == thread) {
return NULL;
}
coobjc_test_thread_s test;
test.queue = (void*)tiid.dispatch_qaddr;
if (test.queue != NULL) {
return *(__unsafe_unretained dispatch_queue_t*)test.queue;

if (tiid.dispatch_qaddr != 0) {
return *(__unsafe_unretained dispatch_queue_t*)(void*)tiid.dispatch_qaddr;
}
return NULL;
}
Expand Down

0 comments on commit 7ae3a79

Please sign in to comment.