Revision: | 1.3 |
Committed: | Mon Feb 18 21:25:02 2002 UTC (22 years, 4 months ago) by root |
Content type: | application/x-troff |
Branch: | MAIN |
CVS Tags: | rel-1_9, rel-1_2, rel-1_1, rel-1_5, rel-2_5, rel-1_4, rel-2_0, rel-2_1, rel-1_7, rel-1_0, rel-1_6, rel-1_31 |
Changes since 1.2: | +4 -4 lines |
Log Message: | *** empty log message *** |
# | Content |
---|---|
1 | $|=1; |
2 | print "1..8\n"; |
3 | |
4 | use Coro; |
5 | use Coro::Signal; |
6 | use Coro::Timer; |
7 | |
8 | print "ok 1\n"; |
9 | |
10 | my $signal = new Coro::Signal; |
11 | |
12 | new Coro::Timer after => 0, cb => sub { |
13 | print "ok 2\n"; |
14 | }; |
15 | new Coro::Timer at => time + 1, cb => sub { |
16 | print "ok 4\n"; |
17 | }; |
18 | new Coro::Timer after => 3, cb => sub { |
19 | $signal->send; |
20 | }; |
21 | new Coro::Timer after => 0, cb => sub { |
22 | print "ok 3\n"; |
23 | }; |
24 | (new Coro::Timer after => 0, cb => sub { |
25 | print "not ok 4\n"; |
26 | })->cancel; |
27 | new Coro::Timer at => time + 5, cb => sub { |
28 | print "ok 7\n"; |
29 | $Coro::main->ready; |
30 | }; |
31 | |
32 | print $signal->timed_wait(2) ? "not ok" : "ok", " 5\n"; |
33 | print $signal->timed_wait(2) ? "ok" : "not ok", " 6\n"; |
34 | schedule; |
35 | print "ok 8\n"; |