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

Comparing cvsroot/Async-Interrupt/Interrupt.pm (file contents):
Revision 1.20 by root, Tue Jul 28 13:35:57 2009 UTC vs.
Revision 1.27 by root, Sat May 15 00:08:48 2010 UTC

233use common::sense; 233use common::sense;
234 234
235BEGIN { 235BEGIN {
236 # the next line forces initialisation of internal 236 # the next line forces initialisation of internal
237 # signal handling variables, otherwise, PL_sig_pending 237 # signal handling variables, otherwise, PL_sig_pending
238 # etc. will be null pointers. 238 # etc. might be null pointers.
239 $SIG{KILL} = sub { }; 239 $SIG{KILL} = sub { };
240 240
241 our $VERSION = '1.0'; 241 our $VERSION = '1.05';
242 242
243 require XSLoader; 243 require XSLoader;
244 XSLoader::load ("Async::Interrupt", $VERSION); 244 XSLoader::load ("Async::Interrupt", $VERSION);
245} 245}
246 246
536 536
537=back 537=back
538 538
539=head1 THE Async::Interrupt::EventPipe CLASS 539=head1 THE Async::Interrupt::EventPipe CLASS
540 540
541Pipes are the predominent utility to make asynchronous signals 541Pipes are the predominant utility to make asynchronous signals
542synchronous. However, pipes are hard to come by: they don't exist on the 542synchronous. However, pipes are hard to come by: they don't exist on the
543broken windows platform, and on GNU/Linux systems, you might want to use 543broken windows platform, and on GNU/Linux systems, you might want to use
544an C<eventfd> instead. 544an C<eventfd> instead.
545 545
546This class creates selectable event pipes in a portable fashion: on 546This class creates selectable event pipes in a portable fashion: on
576 576
577=item $epipe->drain 577=item $epipe->drain
578 578
579Drain (empty) the pipe. 579Drain (empty) the pipe.
580 580
581=item ($c_func, $c_arg) = $epipe->signal_func
582
583=item ($c_func, $c_arg) = $epipe->drain_func
584
585These two methods returns a function pointer and C<void *> argument
586that can be called to have the effect of C<< $epipe->signal >> or C<<
587$epipe->drain >>, respectively, on the XS level.
588
589They both have the following prototype and need to be passed their
590C<$c_arg>, which is a C<void *> cast to an C<IV>:
591
592 void (*c_func) (void *c_arg)
593
594An example call would look like:
595
596 c_func (c_arg);
597
581=item $epipe->renew 598=item $epipe->renew
582 599
583Recreates the pipe (useful after a fork). The reading side will not change 600Recreates the pipe (useful after a fork). The reading side will not change
584it's file descriptor number, but the writing side might. 601it's file descriptor number, but the writing side might.
585 602
603=item $epipe->wait
604
605This method blocks the process until there are events on the pipe. This is
606not a very event-based or ncie way of usign an event pipe, but it can be
607occasionally useful.
608
586=back 609=back
587 610
588=cut 611=cut
589 612
5901; 6131;
591
592=head1 EXAMPLE
593
594There really should be a complete C/XS example. Bug me about it. Better
595yet, create one.
596 614
597=head1 IMPLEMENTATION DETAILS AND LIMITATIONS 615=head1 IMPLEMENTATION DETAILS AND LIMITATIONS
598 616
599This module works by "hijacking" SIGKILL, which is guaranteed to always 617This module works by "hijacking" SIGKILL, which is guaranteed to always
600exist, but also cannot be caught, so is always available. 618exist, but also cannot be caught, so is always available.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines