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 _ =
|
1996-04-29 07:06:05 -07:00
|
|
|
Thread.create (f "A") "hello";
|
1996-04-18 09:32:38 -07:00
|
|
|
f "B" "world";
|
1996-04-02 00:41:32 -08:00
|
|
|
exit 0
|
|
|
|
|
|
|
|
|