countDown

fun CountDownLatch.countDown(block: () -> Unit)

Executes block and calls CountDownLatch.countDown in a finally block, ensuring the latch is decremented even if the block throws.

Parameters

block

the code to execute before counting down.