diff options
Diffstat (limited to 'test/pending/run')
-rw-r--r-- | test/pending/run/signals.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/pending/run/signals.scala b/test/pending/run/signals.scala new file mode 100644 index 0000000000..608b3c7fd5 --- /dev/null +++ b/test/pending/run/signals.scala @@ -0,0 +1,22 @@ +// not exactly "pending", here as an example usage. +// +val manager = scala.tools.util.SignalManager + +manager.requireInterval(3, manager.INT) { + case true => Console.println("\nPress ctrl-C again to exit.") + case false => System.exit(1) +} + +manager("HUP") = println("HUP 1!") +manager("HUP").raise() + +manager("HUP") += println("HUP 2!") +manager("HUP").raise() + +manager("HUP") += println("HUP 3!") +manager("HUP").raise() + +manager("HUP") = println("Back to HUP 1!") +manager("HUP").raise() + +manager.dump() |