Count-down latches


The concurrency.count-downs vocabulary implements the count-down latch data type, which is a wrapper for a non-negative integer value which tends towards zero. A thread can either decrement the value, or wait for it to become zero.
<count-down> ( n -- count-down )

count-down ( count-down -- )

await ( count-down -- )


The vocabulary was modelled after a similar feature in Java's java.util.concurrent library.