ios - How to find conflicting thread in frozen UI -
i having ui frozen/blocked due semaphore_wait_trap in main thread.
when ui frozen, pause using xcode , last 2 lines in stacktrace:
0x103f0ea30 <+809>: callq 0x103f1554d ; _dispatch_thread_semaphore_wait dispatch_sync(somequeue, block); // code.
how can find causing block?
any other suggestion find out causing block?
it blocks on same line/code.
in debug navigator (cmd-6), should have list of threads. 1 other thread in there should waiting somequeue well. can't think off hand of case wasn't case. 2 threads waiting each other, (e.g. via dispatch_sync).
for example, might have this:
dispatch_sync(myserialqueue, ^{ [self foo]; });
and
- (void)foo { dispatch_sync(myserialqueue, ^{ ... }); }
the latter waiting former finish forever, because former holding onto myqueue until finishes call -foo
.
(note myserialqueue
has created dispatch_queue_serial
happen.)
Comments
Post a Comment