IOS semaphore_wait_trap on main thread causing hang in UI
I have a long running function inside an asynchronous (serial) worker queue. I know that sometimes this function hangs inside a particular openCV call. For some reason this hang is also causing the main thread to hang. When pausing and entering debug mode I see that there is a call to semaphore_wait_trap() on the main thread (Queue) I can suspend the hanging thread (My worker queue) in debug mode and then this trap goes away and the GUI becomes responsive once again on the phone. After unpausing the worker thread the GUI is responsive for 1-2 seconds (I suspect until this thread is activated