--- Coro/Coro.pm 2003/05/08 00:55:28 1.51 +++ Coro/Coro.pm 2003/11/15 03:53:10 1.56 @@ -32,13 +32,15 @@ package Coro; -no warnings qw(uninitialized); +BEGIN { eval { require warnings } && warnings->unimport ("uninitialized") } use Coro::State; +use vars qw($idle $main $current); + use base Exporter; -$VERSION = 0.652; +$VERSION = "0.9"; @EXPORT = qw(async cede schedule terminate current); %EXPORT_TAGS = ( @@ -85,7 +87,7 @@ =cut -our $main = new Coro; +$main = new Coro; =item $current (or as function: current) @@ -98,7 +100,7 @@ $main->{specific} = $current->{specific}; } -our $current = $main; +$current = $main; sub current() { $current } @@ -110,7 +112,7 @@ =cut # should be done using priorities :( -our $idle = new Coro sub { +$idle = new Coro sub { print STDERR "FATAL: deadlock detected\n"; exit(51); }; @@ -269,7 +271,7 @@ Sets (or gets, if the argument is missing) the priority of the process. Higher priority processes get run before lower priority -processes. Priorities are smalled signed integer (currently -4 .. +3), +processes. Priorities are small signed integers (currently -4 .. +3), that you can refer to using PRIO_xxx constants (use the import tag :prio to get then): @@ -327,17 +329,19 @@ =head1 BUGS/LIMITATIONS - - you must make very sure that no coro is still active on global destruction. - very bad things might happen otherwise (usually segfaults). - - this module is not thread-safe. You should only ever use this module from - the same thread (this requirement might be loosened in the future to - allow per-thread schedulers, but Coro::State does not yet allow this). + - you must make very sure that no coro is still active on global + destruction. very bad things might happen otherwise (usually segfaults). + + - this module is not thread-safe. You should only ever use this module + from the same thread (this requirement might be losened in the future + to allow per-thread schedulers, but Coro::State does not yet allow + this). =head1 SEE ALSO L, L, L, L, -L, L, L, L, -L, L. +L, L, L, L, +L, Handle>, L. =head1 AUTHOR