RosettaCodeData/Task/Synchronous-concurrency/OCaml/synchronous-concurrency-3.ocaml
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

6 lines
215 B
Text

let printer lines_source count_target =
let rec aux i =
match sync (receive lines_source) with
| Some line -> print_endline line; aux ( i + 1 )
| None -> sync (send count_target i)
in aux 0