I have a Cocoa UI application that should update its main window as fast as its entire UI event loop, so I implemented the main update function through CFRunLoopObserver. I also have a modal warning application window and a context menu.
So my problem is that when I have a warning and a context menu on the screen, the update program gets stuck, apparently due to the excessive number of nested start cycles above the one to which it was attached back at the beginning. Surprisingly, I can mitigate the problem by duplicating the observer, and it continues to work - only one case, randomly selected from the two existing ones, when the "lock" of the nested loop begins. When it ends (a menu item is selected, a warning exceeds its timeout or is manually canceled - regardless of that), everything returns to its normal state, and a blocked observer restores the ability to start.
Now the question is: is there a way for one observer to start regardless of how deep the execution cycle stack is?
source
share