1996-04-02 00:41:32 -08:00
|
|
|
open Event
|
|
|
|
|
|
|
|
let ch = (new_channel() : string channel)
|
|
|
|
|
|
|
|
let rec f tag msg =
|
|
|
|
select [
|
|
|
|
send ch msg;
|
|
|
|
wrap (receive ch) (fun x -> print_string(tag ^ ": " ^ x); print_newline())
|
|
|
|
];
|
|
|
|
f tag msg
|
|
|
|
|
|
|
|
let _ =
|
|
|
|
Thread.new (f "A") "hello";
|
1996-04-18 09:32:38 -07:00
|
|
|
f "B" "world";
|
1996-04-02 00:41:32 -08:00
|
|
|
exit 0
|
|
|
|
|
|
|
|
|