Skip to content

循环一个子线程,第一次打印的堆栈有时候只有一条 #6

@ganvinalix

Description

@ganvinalix

dispatch_async(dispatch_get_global_queue(0, 0), ^{ // something for (NSInteger i = 0; i < 5000 ; i ++) { NSLog(@"index----- %@",@(i)); NSString * ddd = [KGPrintThreadSnapshoot bs_backtraceOfCurrentThread]; NSLog(@"bs_backtraceOfCurrentThread----- %@",ddd); } });

打印结果:
index==1
bs_backtraceOfCurrentThread----- Backtrace of Thread 3587:
libsystem_kernel.dylib 0x111127f72 mach_msg_trap + 10
index==2的时候 就准确了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions