Can't you just always make sure when you're blocking on app thread that you keep processing?  i.e. if on app loop you need to make sure you spin a while loop, calling the app process loop.  If you get re-entry, then you'll just be spinning on the inner loop, and once that exits, the outer loop will also exit, right?