… | … | ||
---|---|---|---|
16 | cede; # yield to coroutine | 16 | cede; # yield to coroutine |
17 | print "3\n"; | 17 | print "3\n"; |
18 | cede; # and again | 18 | cede; # and again |
19 | 19 | ||
20 | # use locking | 20 | # use locking |
21 | use Coro::Semaphore; | ||
21 | my $lock = new Coro::Semaphore; | 22 | my $lock = new Coro::Semaphore; |
22 | my $locked; | 23 | my $locked; |
23 | 24 | ||
24 | $lock->down; | 25 | $lock->down; |
25 | $locked = 1; | 26 | $locked = 1; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |