3

I have a background thread that polls UI thread every 200ms. If there is a hang for 2 seconds, I would like to get the call stack from UI thread at that point. When I call [NSThread callStackSymbols], it is executed on background thread since I check If the hang is more than 2 secs in background thread.

is there an easy way to get call stack on main thread from bg thread?

ilker Acar
  • 401
  • 1
  • 5
  • 11

1 Answers1

0

Here is how to do it "manually". Well, if I understand you right one of the threads is doing some heavy lifting which takes too long time. For these cases I just hit the pause button in xcode to pause the debugger. Then it is easy to inspect the callstack and see which method is blocking from continuing.

hfossli
  • 22,616
  • 10
  • 116
  • 130