Bridging async > sync code in swift concurrency

You can implement a safe-to-use semaphore by using continuations. See the discussions here.