And a final thought before I head off on holiday: consider the event
sequence
0. start a signal watcher
1. receive a signal
2. start a second watcher for the same signal
3. send another signal
4. process events
At the moment, both watchers get events with hits=2. The correct
behaviour would be for the first watcher to get hits=2 and the second to
get hits=1. An asynccheck, perhaps restricted to the signal in question,
in the watcher start code would fix this. Test program:
#!/usr/bin/perl
use warnings;
use strict;
use Event;
Event->signal(signal => "USR1",
cb => sub { print "handler 0 got hits=", $_[0]->hits, "\n"; });
kill "USR1" => 0;
Event->signal(signal => "USR1",
cb => sub { print "handler 1 got hits=", $_[0]->hits, "\n"; });
kill "USR1" => 0;
Event::loop;
-zefram