ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Coro-Multicore/Multicore.pm
(Generate patch)

Comparing cvsroot/Coro-Multicore/Multicore.pm (file contents):
Revision 1.17 by root, Mon Jun 24 19:45:53 2019 UTC vs.
Revision 1.18 by root, Tue Dec 3 07:12:28 2019 UTC

244=cut 244=cut
245 245
246package Coro::Multicore; 246package Coro::Multicore;
247 247
248use Coro (); 248use Coro ();
249use AnyEvent ();
250 249
251BEGIN { 250BEGIN {
252 our $VERSION = '1.03'; 251 our $VERSION = '1.04';
253 252
254 use XSLoader; 253 use XSLoader;
255 XSLoader::load __PACKAGE__, $VERSION; 254 XSLoader::load __PACKAGE__, $VERSION;
256} 255}
257 256
263 } 262 }
264 263
265 enable 1; 264 enable 1;
266} 265}
267 266
267our $WATCHER;
268
269# called when first thread is started, on first release. can
270# be called manually, but is not currently a public interface.
271sub init {
272 require AnyEvent; # maybe load it unconditionally?
268our $WATCHER = AE::io fd, 0, \&poll; 273 $WATCHER ||= AE::io (fd, 0, \&poll);
274}
269 275
270=head1 THREAD SAFETY OF SUPPORTING XS MODULES 276=head1 THREAD SAFETY OF SUPPORTING XS MODULES
271 277
272Just because an XS module supports perlmulticore might not immediately 278Just because an XS module supports perlmulticore might not immediately
273make it reentrant. For example, while you can (try to) call C<execute> 279make it reentrant. For example, while you can (try to) call C<execute>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines