1998-08-08 09:54:14 -07:00
|
|
|
let print_message delay c =
|
|
|
|
while true do
|
|
|
|
print_char c; flush stdout; Thread.delay delay
|
|
|
|
done
|
|
|
|
|
|
|
|
let _ =
|
|
|
|
let th1 = Thread.create (print_message 0.6666666666) 'a' in
|
|
|
|
let th2 = Thread.create (print_message 1.0) 'b' in
|
1998-08-08 11:42:22 -07:00
|
|
|
let s = Thread.wait_signal [Sys.sigint; Sys.sigterm] in
|
1998-08-08 09:54:14 -07:00
|
|
|
Printf.printf "Got signal %d, exiting...\n" s
|