[svn-upgrade] Integrating new upstream version, libcoro-perl (5.230)
Gregor Herrmann
14 years ago
5 | 5 | TODO: channel->maxsize(newsize)? |
6 | 6 | TODO: http://www.microsoft.com/msj/archive/s2ce.aspx |
7 | 7 | |
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 | ||
8 | 14 | 5.22 Wed Apr 14 03:55:35 CEST 2010 |
9 | 15 | - correctly return udnef on errors in Coro::Handle::read/write |
10 | (testcase by Marc Wims). | |
16 | (testcase by Marc Mims). | |
11 | 17 | - convert Coro::Util into a "perl compatibility wrapper" - the functions |
12 | 18 | are less useful now, but are drop-in replacements for existing |
13 | 19 | functions, listing better alternatives in the documentation. This also |
67 | 67 | |
68 | 68 | use base Exporter::; |
69 | 69 | |
70 | our $VERSION = 5.22; | |
70 | our $VERSION = 5.23; | |
71 | 71 | |
72 | 72 | our @EXPORT = (@IO::AIO::EXPORT, qw(aio_wait)); |
73 | 73 | our @EXPORT_OK = @IO::AIO::EXPORT_OK; |
154 | 154 | use Coro; |
155 | 155 | use AnyEvent (); |
156 | 156 | |
157 | our $VERSION = 5.22; | |
157 | our $VERSION = 5.23; | |
158 | 158 | |
159 | 159 | ############################################################################# |
160 | 160 | # idle handler |
175 | 175 | AnyEvent::post_detect { |
176 | 176 | unshift @AnyEvent::CondVar::ISA, "Coro::AnyEvent::CondVar"; |
177 | 177 | |
178 | Coro::_set_readyhook undef; | |
179 | ||
180 | 178 | my $model = $AnyEvent::MODEL; |
181 | 179 | |
182 | 180 | 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 (); | |
184 | 183 | |
185 | 184 | eval ' |
186 | 185 | *sleep = \&Coro::EV::timer_once; |
205 | 204 | die if $@; |
206 | 205 | |
207 | 206 | } elsif ($model eq "AnyEvent::Impl::Event" and eval { require Coro::Event }) { |
207 | Coro::_set_readyhook undef; | |
208 | 208 | # let Coro::Event do its thing |
209 | 209 | } else { |
210 | 210 | # do the inefficient thing ourselves |
46 | 46 | |
47 | 47 | use base Exporter::; |
48 | 48 | |
49 | our $VERSION = 5.22; | |
49 | our $VERSION = 5.23; | |
50 | 50 | our $WATCHER; |
51 | 51 | |
52 | 52 | BDB::set_sync_prepare { |
31 | 31 | use Coro (); |
32 | 32 | use Coro::Semaphore (); |
33 | 33 | |
34 | our $VERSION = 5.22; | |
34 | our $VERSION = 5.23; | |
35 | 35 | |
36 | 36 | sub DATA (){ 0 } |
37 | 37 | sub SGET (){ 1 } |
120 | 120 | use Coro::AnyEvent (); |
121 | 121 | use Coro::Timer (); |
122 | 122 | |
123 | our $VERSION = 5.22; | |
123 | our $VERSION = 5.23; | |
124 | 124 | |
125 | 125 | our %log; |
126 | 126 | our $SESLOGLEVEL = exists $ENV{PERL_CORO_DEFAULT_LOGLEVEL} ? $ENV{PERL_CORO_DEFAULT_LOGLEVEL} : -1; |
44 | 44 | |
45 | 45 | use base 'Exporter'; |
46 | 46 | |
47 | our $VERSION = 5.22; | |
47 | our $VERSION = 5.23; | |
48 | 48 | our @EXPORT = qw(unblock); |
49 | 49 | |
50 | 50 | =item $fh = new_from_fh Coro::Handle $fhandle [, arg => value...] |
93 | 93 | use Net::FTP (); |
94 | 94 | use Net::NNTP (); |
95 | 95 | |
96 | our $VERSION = 5.22; | |
96 | our $VERSION = 5.23; | |
97 | 97 | |
98 | 98 | *Socket::inet_aton = \&Coro::Util::inet_aton; |
99 | 99 |
6 | 6 | |
7 | 7 | our $installsitearch; |
8 | 8 | |
9 | our $VERSION = 5.22; | |
9 | our $VERSION = 5.23; | |
10 | 10 | our @EXPORT_OK = qw(&coro_args $installsitearch); |
11 | 11 | |
12 | 12 | my %opt; |
323 | 323 | |
324 | 324 | Coro has experimental support for cloning states. This can be used |
325 | 325 | 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. | |
331 | 331 | |
332 | 332 | EOF |
333 | 333 |
29 | 29 | |
30 | 30 | use Coro (); |
31 | 31 | |
32 | our $VERSION = 5.22; | |
32 | our $VERSION = 5.23; | |
33 | 33 | |
34 | 34 | =item $l = new Coro::RWLock; |
35 | 35 |
66 | 66 | |
67 | 67 | use base Exporter::; |
68 | 68 | |
69 | our $VERSION = 5.22; | |
69 | our $VERSION = 5.23; | |
70 | 70 | our @EXPORT_OK = "select"; |
71 | 71 | |
72 | 72 | sub import { |
36 | 36 | |
37 | 37 | use Coro (); |
38 | 38 | |
39 | our $VERSION = 5.22; | |
39 | our $VERSION = 5.23; | |
40 | 40 | |
41 | 41 | =item new [inital count] |
42 | 42 |
31 | 31 | |
32 | 32 | use common::sense; |
33 | 33 | |
34 | our $VERSION = 5.22; | |
34 | our $VERSION = 5.23; | |
35 | 35 | |
36 | 36 | use Coro::Semaphore (); |
37 | 37 |
34 | 34 | |
35 | 35 | use Coro::Semaphore (); |
36 | 36 | |
37 | our $VERSION = 5.22; | |
37 | our $VERSION = 5.23; | |
38 | 38 | |
39 | 39 | =item $sig = new Coro::Signal; |
40 | 40 |
72 | 72 | |
73 | 73 | use base qw(Coro::Handle IO::Socket::INET); |
74 | 74 | |
75 | our $VERSION = 5.22; | |
75 | our $VERSION = 5.23; | |
76 | 76 | |
77 | 77 | our (%_proto, %_port); |
78 | 78 |
25 | 25 | |
26 | 26 | use common::sense; |
27 | 27 | |
28 | our $VERSION = 5.22; | |
28 | our $VERSION = 5.23; | |
29 | 29 | |
30 | 30 | =item new |
31 | 31 |
91 | 91 | use XSLoader; |
92 | 92 | |
93 | 93 | BEGIN { |
94 | our $VERSION = 5.22; | |
94 | our $VERSION = 5.23; | |
95 | 95 | |
96 | 96 | # must be done here because the xs part expects it to exist |
97 | 97 | # it might exist already because Coro::Specific created it. |
83 | 83 | use Storable; |
84 | 84 | use base "Exporter"; |
85 | 85 | |
86 | our $VERSION = 5.22; | |
86 | our $VERSION = 5.23; | |
87 | 87 | our @EXPORT = qw(thaw freeze nfreeze blocking_thaw blocking_freeze blocking_nfreeze); |
88 | 88 | |
89 | 89 | our $GRANULARITY = 0.01; |
29 | 29 | use Coro (); |
30 | 30 | use Coro::AnyEvent (); |
31 | 31 | |
32 | our $VERSION = 5.22; | |
32 | our $VERSION = 5.23; | |
33 | 33 | our @EXPORT_OK = qw(timeout sleep); |
34 | 34 | |
35 | 35 | =item $flag = timeout $seconds; |
40 | 40 | our @EXPORT = qw(gethostbyname gethostbyaddr); |
41 | 41 | our @EXPORT_OK = qw(inet_aton fork_eval); |
42 | 42 | |
43 | our $VERSION = 5.22; | |
43 | our $VERSION = 5.23; | |
44 | 44 | |
45 | 45 | our $MAXPARALLEL = 16; # max. number of parallel jobs |
46 | 46 |
82 | 82 | our $main; # main coro |
83 | 83 | our $current; # current coro |
84 | 84 | |
85 | our $VERSION = 5.22; | |
85 | our $VERSION = 5.23; | |
86 | 86 | |
87 | 87 | our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait); |
88 | 88 | our %EXPORT_TAGS = ( |
55 | 55 | use XSLoader; |
56 | 56 | |
57 | 57 | BEGIN { |
58 | our $VERSION = 5.22; | |
58 | our $VERSION = 5.23; | |
59 | 59 | |
60 | 60 | local $^W = 0; # avoid redefine warning for Coro::ready; |
61 | 61 | XSLoader::load __PACKAGE__, $VERSION; |
296 | 296 | ev_idle_init (&idler, idle_cb); |
297 | 297 | ev_set_priority (&idler, EV_MINPRI); |
298 | 298 | |
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: | |
299 | 309 | CORO_READYHOOK = readyhook; |
300 | CORO_READYHOOK (); /* make sure we don't miss previous ready's */ | |
301 | } | |
310 | CORO_READYHOOK (); | |
302 | 311 | |
303 | 312 | void |
304 | 313 | _loop_oneshot () |
91 | 91 | our @EXPORT = qw(loop unloop sweep); |
92 | 92 | |
93 | 93 | BEGIN { |
94 | our $VERSION = 5.22; | |
94 | our $VERSION = 5.23; | |
95 | 95 | |
96 | 96 | local $^W = 0; # avoid redefine warning for Coro::ready; |
97 | 97 | XSLoader::load __PACKAGE__, $VERSION; |
89 | 89 | doc/cede-vs-schedule |
90 | 90 | |
91 | 91 | META.yml Module meta-data (added by MakeMaker) |
92 | META.json Module meta-data (added by MakeMaker) |
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 |