In order to fix bug 51352, we'll need a way to run a RunLoop until a BinarySemaphore is signaled or a timeout elapses.
Created attachment 80649 [details]
WIP patch for discussion
This got fixed as part of bug 58239. I didn't add a completely generic mechanism, just what was needed to fix that bug.
*** This bug has been marked as a duplicate of bug 58239 ***