… | |
… | |
13 | print "ok 2\n"; |
13 | print "ok 2\n"; |
14 | }; |
14 | }; |
15 | new Coro::Timer at => time + 1, cb => sub { |
15 | new Coro::Timer at => time + 1, cb => sub { |
16 | print "ok 4\n"; |
16 | print "ok 4\n"; |
17 | }; |
17 | }; |
18 | new Coro::Timer after => 2, cb => sub { |
18 | new Coro::Timer after => 3, cb => sub { |
19 | $signal->send; |
19 | $signal->send; |
20 | }; |
20 | }; |
21 | new Coro::Timer after => 0, cb => sub { |
21 | new Coro::Timer after => 0, cb => sub { |
22 | print "ok 3\n"; |
22 | print "ok 3\n"; |
23 | }; |
23 | }; |
24 | (new Coro::Timer after => 0, cb => sub { |
24 | (new Coro::Timer after => 0, cb => sub { |
25 | print "not ok 4\n"; |
25 | print "not ok 4\n"; |
26 | })->cancel; |
26 | })->cancel; |
27 | new Coro::Timer at => time + 3, cb => sub { |
27 | new Coro::Timer at => time + 5, cb => sub { |
28 | print "ok 7\n"; |
28 | print "ok 7\n"; |
29 | $Coro::main->ready; |
29 | $Coro::main->ready; |
30 | }; |
30 | }; |
31 | |
31 | |
32 | print $signal->timed_wait(1) ? "not ok" : "ok", " 5\n"; |
32 | print $signal->timed_wait(2) ? "not ok" : "ok", " 5\n"; |
33 | print $signal->timed_wait(1) ? "ok" : "not ok", " 6\n"; |
33 | print $signal->timed_wait(2) ? "ok" : "not ok", " 6\n"; |
34 | schedule; |
34 | schedule; |
35 | print "ok 8\n"; |
35 | print "ok 8\n"; |