1 USING: help.markup help.syntax sequences ;
\r
2 IN: concurrency.count-downs
\r
5 { $values { "n" "a non-negative integer" } { "count-down" count-down } }
\r
6 { $description "Creates a new count-down latch." }
\r
7 { $errors "Throws an error if the count is lower than zero." } ;
\r
10 { $values { "count-down" count-down } }
\r
11 { $description "Decrements a count-down latch. If it reaches zero, all threads blocking on " { $link await } " are notified." }
\r
12 { $errors "Throws an error if an attempt is made to decrement the count lower than zero." } ;
\r
15 { $values { "count-down" count-down } }
\r
16 { $description "Waits until the count-down value reaches zero." } ;
\r
18 ARTICLE: "concurrency.count-downs" "Count-down latches"
\r
19 "The " { $vocab-link "concurrency.count-downs" } " vocabulary implements the " { $emphasis "count-down latch" } " data type, whichis 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."
\r
20 { $subsection <count-down> }
\r
21 { $subsection count-down }
\r
22 { $subsection await }
\r
23 "The vocabulary was modelled after a similar feature in Java's " { $snippet "java.util.concurrent" } " library." ;
\r
25 ABOUT: "concurrency.count-downs"
\r