Using DispatchSemaphore to control async execution

I’ve been debugging the upcoming OPML Import functionality of NewsWave and this bug was driving me nuts:  in some cases and for no apparent reason URLSessions would fail without a callback.  At first the bug seemed random, but after a bit of testing I realized the more feeds I tried to import, the more likely the bug …