Codebase list libcoro-perl / 3d2bc06
[svn-upgrade] Integrating new upstream version, libcoro-perl (5.230) Gregor Herrmann 14 years ago
28 changed file(s) with 81 addition(s) and 76 deletion(s). Raw diff Collapse all Expand all
55 TODO: channel->maxsize(newsize)?
66 TODO: http://www.microsoft.com/msj/archive/s2ce.aspx
77
8 5.23 Mon May 17 18:50:42 CEST 2010
9 - be more resistant to ordering changes when initialising
10 Coro::AnyEvent, Coro::EV and Coro::Event (reported by Matthias
11 Waldorf).
12 - document that perl 5.12 deliberately removed support for cloning.
13
814 5.22 Wed Apr 14 03:55:35 CEST 2010
915 - correctly return udnef on errors in Coro::Handle::read/write
10 (testcase by Marc Wims).
16 (testcase by Marc Mims).
1117 - convert Coro::Util into a "perl compatibility wrapper" - the functions
1218 are less useful now, but are drop-in replacements for existing
1319 functions, listing better alternatives in the documentation. This also
6767
6868 use base Exporter::;
6969
70 our $VERSION = 5.22;
70 our $VERSION = 5.23;
7171
7272 our @EXPORT = (@IO::AIO::EXPORT, qw(aio_wait));
7373 our @EXPORT_OK = @IO::AIO::EXPORT_OK;
154154 use Coro;
155155 use AnyEvent ();
156156
157 our $VERSION = 5.22;
157 our $VERSION = 5.23;
158158
159159 #############################################################################
160160 # idle handler
175175 AnyEvent::post_detect {
176176 unshift @AnyEvent::CondVar::ISA, "Coro::AnyEvent::CondVar";
177177
178 Coro::_set_readyhook undef;
179
180178 my $model = $AnyEvent::MODEL;
181179
182180 if ($model eq "AnyEvent::Impl::EV" and eval { require Coro::EV }) {
183 # provider faster versions of some functions
181 # provide faster versions of some functions
182 Coro::EV::_set_readyhook ();
184183
185184 eval '
186185 *sleep = \&Coro::EV::timer_once;
205204 die if $@;
206205
207206 } elsif ($model eq "AnyEvent::Impl::Event" and eval { require Coro::Event }) {
207 Coro::_set_readyhook undef;
208208 # let Coro::Event do its thing
209209 } else {
210210 # do the inefficient thing ourselves
4646
4747 use base Exporter::;
4848
49 our $VERSION = 5.22;
49 our $VERSION = 5.23;
5050 our $WATCHER;
5151
5252 BDB::set_sync_prepare {
3131 use Coro ();
3232 use Coro::Semaphore ();
3333
34 our $VERSION = 5.22;
34 our $VERSION = 5.23;
3535
3636 sub DATA (){ 0 }
3737 sub SGET (){ 1 }
120120 use Coro::AnyEvent ();
121121 use Coro::Timer ();
122122
123 our $VERSION = 5.22;
123 our $VERSION = 5.23;
124124
125125 our %log;
126126 our $SESLOGLEVEL = exists $ENV{PERL_CORO_DEFAULT_LOGLEVEL} ? $ENV{PERL_CORO_DEFAULT_LOGLEVEL} : -1;
4444
4545 use base 'Exporter';
4646
47 our $VERSION = 5.22;
47 our $VERSION = 5.23;
4848 our @EXPORT = qw(unblock);
4949
5050 =item $fh = new_from_fh Coro::Handle $fhandle [, arg => value...]
9393 use Net::FTP ();
9494 use Net::NNTP ();
9595
96 our $VERSION = 5.22;
96 our $VERSION = 5.23;
9797
9898 *Socket::inet_aton = \&Coro::Util::inet_aton;
9999
66
77 our $installsitearch;
88
9 our $VERSION = 5.22;
9 our $VERSION = 5.23;
1010 our @EXPORT_OK = qw(&coro_args $installsitearch);
1111
1212 my %opt;
323323
324324 Coro has experimental support for cloning states. This can be used
325325 to implement a scheme-like call/cc. However, this doesn't add to the
326 expressiveness in general, and is likely perl-version specific. As such,
327 it is disabled by default. Enable it when you want to play around with
328 it, but note that it isn't supported, and unlikely ever will be. It
329 exists mainly to prove that it could be done - if only it were useful for
330 something.
326 expressiveness in general, and is likely perl-version specific (and perl
327 5.12 deliberately removed support for it). As such, it is disabled by
328 default. Enable it when you want to play around with it, but note that it
329 isn't supported, and unlikely ever will be. It exists mainly to prove that
330 it could be done - if only it were useful for something.
331331
332332 EOF
333333
2929
3030 use Coro ();
3131
32 our $VERSION = 5.22;
32 our $VERSION = 5.23;
3333
3434 =item $l = new Coro::RWLock;
3535
6666
6767 use base Exporter::;
6868
69 our $VERSION = 5.22;
69 our $VERSION = 5.23;
7070 our @EXPORT_OK = "select";
7171
7272 sub import {
3636
3737 use Coro ();
3838
39 our $VERSION = 5.22;
39 our $VERSION = 5.23;
4040
4141 =item new [inital count]
4242
3131
3232 use common::sense;
3333
34 our $VERSION = 5.22;
34 our $VERSION = 5.23;
3535
3636 use Coro::Semaphore ();
3737
3434
3535 use Coro::Semaphore ();
3636
37 our $VERSION = 5.22;
37 our $VERSION = 5.23;
3838
3939 =item $sig = new Coro::Signal;
4040
7272
7373 use base qw(Coro::Handle IO::Socket::INET);
7474
75 our $VERSION = 5.22;
75 our $VERSION = 5.23;
7676
7777 our (%_proto, %_port);
7878
2525
2626 use common::sense;
2727
28 our $VERSION = 5.22;
28 our $VERSION = 5.23;
2929
3030 =item new
3131
9191 use XSLoader;
9292
9393 BEGIN {
94 our $VERSION = 5.22;
94 our $VERSION = 5.23;
9595
9696 # must be done here because the xs part expects it to exist
9797 # it might exist already because Coro::Specific created it.
8383 use Storable;
8484 use base "Exporter";
8585
86 our $VERSION = 5.22;
86 our $VERSION = 5.23;
8787 our @EXPORT = qw(thaw freeze nfreeze blocking_thaw blocking_freeze blocking_nfreeze);
8888
8989 our $GRANULARITY = 0.01;
2929 use Coro ();
3030 use Coro::AnyEvent ();
3131
32 our $VERSION = 5.22;
32 our $VERSION = 5.23;
3333 our @EXPORT_OK = qw(timeout sleep);
3434
3535 =item $flag = timeout $seconds;
4040 our @EXPORT = qw(gethostbyname gethostbyaddr);
4141 our @EXPORT_OK = qw(inet_aton fork_eval);
4242
43 our $VERSION = 5.22;
43 our $VERSION = 5.23;
4444
4545 our $MAXPARALLEL = 16; # max. number of parallel jobs
4646
8282 our $main; # main coro
8383 our $current; # current coro
8484
85 our $VERSION = 5.22;
85 our $VERSION = 5.23;
8686
8787 our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait);
8888 our %EXPORT_TAGS = (
5555 use XSLoader;
5656
5757 BEGIN {
58 our $VERSION = 5.22;
58 our $VERSION = 5.23;
5959
6060 local $^W = 0; # avoid redefine warning for Coro::ready;
6161 XSLoader::load __PACKAGE__, $VERSION;
296296 ev_idle_init (&idler, idle_cb);
297297 ev_set_priority (&idler, EV_MINPRI);
298298
299 if (!CORO_READYHOOK) /* do not override if Coro::AnyEvent already did */
300 {
301 CORO_READYHOOK = readyhook;
302 CORO_READYHOOK (); /* make sure we don't miss previous ready's */
303 }
304 }
305
306 void
307 _set_readyhook ()
308 CODE:
299309 CORO_READYHOOK = readyhook;
300 CORO_READYHOOK (); /* make sure we don't miss previous ready's */
301 }
310 CORO_READYHOOK ();
302311
303312 void
304313 _loop_oneshot ()
9191 our @EXPORT = qw(loop unloop sweep);
9292
9393 BEGIN {
94 our $VERSION = 5.22;
94 our $VERSION = 5.23;
9595
9696 local $^W = 0; # avoid redefine warning for Coro::ready;
9797 XSLoader::load __PACKAGE__, $VERSION;
8989 doc/cede-vs-schedule
9090
9191 META.yml Module meta-data (added by MakeMaker)
92 META.json Module meta-data (added by MakeMaker)
+0
-1
META.json less more
0 {"no_index":{"directory":["t","inc"]},"meta-spec":{"version":1.4,"url":"http://module-build.sourceforge.net/META-spec-v1.4.html"},"generated_by":"ExtUtils::MakeMaker version 6.54","distribution_type":"module","version":"5.22","name":"Coro","author":[],"license":"unknown","build_requires":{"ExtUtils::MakeMaker":0},"requires":{"Scalar::Util":0,"AnyEvent":5,"Guard":0.5,"Storable":2.15,"Time::HiRes":0,"common::sense":0},"recommends":{"BDB":0,"AnyEvent::AIO":1,"Event":1.08,"EV":3,"IO::AIO":3.1,"AnyEvent::BDB":1},"abstract":null,"configure_requires":{"ExtUtils::MakeMaker":0}}
0 {
1 "no_index" : {
2 "directory" : [
3 "t",
4 "inc"
5 ]
6 },
7 "meta-spec" : {
8 "version" : 1.4,
9 "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
10 },
11 "generated_by" : "ExtUtils::MakeMaker version 6.54",
12 "distribution_type" : "module",
13 "version" : "5.22",
14 "name" : "Coro",
15 "author" : [],
16 "license" : "unknown",
17 "build_requires" : {
18 "ExtUtils::MakeMaker" : 0
19 },
20 "requires" : {
21 "Scalar::Util" : 0,
22 "AnyEvent" : 5,
23 "Guard" : 0.5,
24 "Storable" : 2.15,
25 "Time::HiRes" : 0,
26 "common::sense" : 0
27 },
28 "recommends" : {
29 "BDB" : 0,
30 "AnyEvent::AIO" : 1,
31 "Event" : 1.08,
32 "EV" : 3,
33 "IO::AIO" : 3.1,
34 "AnyEvent::BDB" : 1
35 },
36 "abstract" : null,
37 "configure_requires" : {
38 "ExtUtils::MakeMaker" : 0
39 }
40 }
0 --- #YAML:1.0
1 name: Coro
2 version: 5.23
3 abstract: ~
4 author: []
5 license: unknown
6 distribution_type: module
7 configure_requires:
8 ExtUtils::MakeMaker: 0
9 build_requires:
10 ExtUtils::MakeMaker: 0
11 requires:
12 AnyEvent: 5
13 common::sense: 0
14 Guard: 0.5
15 Scalar::Util: 0
16 Storable: 2.15
17 Time::HiRes: 0
18 no_index:
19 directory:
20 - t
21 - inc
22 generated_by: ExtUtils::MakeMaker version 6.55_02
23 meta-spec:
24 url: http://module-build.sourceforge.net/META-spec-v1.4.html
25 version: 1.4
26 recommends:
27 AnyEvent::AIO: 1
28 AnyEvent::BDB: 1
29 BDB: 0
30 EV: 3
31 Event: 1.08
32 IO::AIO: 3.1