awaitLatch (CountDownLatch v) = readTVar v >>= ck
    where ck 0 = return ()
          ck _ = retry
awaitLatch (CountDownLatch v) = readTVar v >>= ck
    where ck 0 = return ()
          ck _ = retry
awaitLatch (CountDownLatch v) = readTVar v >>= ck
    where ck 0 = return ()
          ck _ = retry