[poe-commits] poe/POE/Kernel Event.pm,1.22,1.23 Gtk.pm,1.21,1.22 Poll.pm,1.9,1.10 Select.pm,1.31,1.3
Brought to you by:
rcaputo
From: <rc...@us...> - 2002-09-24 06:32:44
|
Update of /cvsroot/poe/poe/POE/Kernel In directory usw-pr-cvs1:/tmp/cvs-serv17360/POE/Kernel Modified Files: Event.pm Gtk.pm Poll.pm Select.pm Tk.pm Log Message: Extract POE's queue code into POE::Queue::Array. Index: Event.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel/Event.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Event.pm 21 Sep 2002 05:57:28 -0000 1.22 --- Event.pm 24 Sep 2002 06:32:41 -0000 1.23 *************** *** 30,34 **** my %signal_watcher; ! my ($kr_sessions, $kr_events); #------------------------------------------------------------------------------ --- 30,34 ---- my %signal_watcher; ! my ($kr_sessions, $kr_queue); #------------------------------------------------------------------------------ *************** *** 38,42 **** my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_events = $kernel->_get_kr_events_ref(); $_watcher_timer = --- 38,42 ---- my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_queue = $kernel->_get_kr_queue_ref(); $_watcher_timer = *************** *** 61,68 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0]->w->signal ], ! time(), __FILE__, __LINE__ ); } --- 61,67 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), ! $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0]->w->signal ], ! __FILE__, __LINE__ ); } *************** *** 71,79 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel->[KR_ACTIVE_SESSION], ! $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0]->w->signal ], ! time(), __FILE__, __LINE__ ); } --- 70,77 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), ! $poe_kernel->[KR_ACTIVE_SESSION], $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, [ $_[0]->w->signal ], ! __FILE__, __LINE__ ); } *************** *** 82,89 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing CHLD-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, ! [ ], ! time(), __FILE__, __LINE__ ); } --- 80,86 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing CHLD-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), ! $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ); } *************** *** 102,109 **** $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, ! [ ], ! time() + 1, __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; --- 99,104 ---- $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time() + 1, $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; *************** *** 130,148 **** } - sub loop_resume_watching_child_signals { - # For SIGCHLD triggered polling loop. - # nothing to do - - # For constant polling loop. - $SIG{CHLD} = 'DEFAULT' if exists $SIG{CHLD}; - $SIG{CLD} = 'DEFAULT' if exists $SIG{CLD}; - $poe_kernel->_enqueue_event - ( $poe_kernel, $poe_kernel, - EN_SCPOLL, ET_SCPOLL, - [ ], - time() + 1, __FILE__, __LINE__ - ) if keys(%$kr_sessions) > 1; - } - sub loop_ignore_signal { my $signal = shift; --- 125,128 ---- *************** *** 231,236 **** # Register the next timed callback if there are events left. ! if (@$kr_events) { ! $_watcher_timer->at( $kr_events->[0]->[ST_TIME] ); $_watcher_timer->start(); --- 211,216 ---- # Register the next timed callback if there are events left. ! if ($kr_queue->get_item_count()) { ! $_watcher_timer->at($kr_queue->get_next_priority()); $_watcher_timer->start(); *************** *** 241,245 **** # to 0. ! if (@$kr_events == 1) { test_for_idle_poe_kernel(); } --- 221,225 ---- # to 0. ! if ($kr_queue->get_item_count() == 1) { test_for_idle_poe_kernel(); } Index: Gtk.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel/Gtk.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Gtk.pm 21 Sep 2002 05:57:28 -0000 1.21 --- Gtk.pm 24 Sep 2002 06:32:41 -0000 1.22 *************** *** 30,34 **** my @fileno_watcher; ! my ($kr_sessions, $kr_events); #------------------------------------------------------------------------------ --- 30,34 ---- my @fileno_watcher; ! my ($kr_sessions, $kr_queue); #------------------------------------------------------------------------------ *************** *** 38,42 **** my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_events = $kernel->_get_kr_events_ref(); Gtk->init; --- 38,42 ---- my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_queue = $kernel->_get_kr_queue_ref(); Gtk->init; *************** *** 56,63 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; --- 56,61 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; *************** *** 67,74 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; --- 65,70 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; *************** *** 81,88 **** $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, ! [ ], ! time(), __FILE__, __LINE__ ); } --- 77,82 ---- $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ); } *************** *** 104,111 **** $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, ! [ ], ! time() + 1, __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; --- 98,103 ---- $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time() + 1, $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; *************** *** 129,148 **** } - sub loop_resume_watching_child_signals { - # For SIGCHLD triggered polling loop. - # $SIG{CHLD} = \&_loop_signal_handler_child if exists $SIG{CHLD}; - # $SIG{CLD} = \&_loop_signal_handler_child if exists $SIG{CLD}; - - # For constant polling loop. - $SIG{CHLD} = 'DEFAULT' if exists $SIG{CHLD}; - $SIG{CLD} = 'DEFAULT' if exists $SIG{CLD}; - $poe_kernel->_enqueue_event - ( $poe_kernel, $poe_kernel, - EN_SCPOLL, ET_SCPOLL, - [ ], - time() + 1, __FILE__, __LINE__ - ) if keys(%$kr_sessions) > 1; - } - sub loop_ignore_signal { my $signal = shift; --- 121,124 ---- *************** *** 192,196 **** sub _loop_resume_timer { Gtk->idle_remove($_watcher_timer); ! loop_resume_time_watcher($poe_kernel->[KR_EVENTS]->[0]->[ST_TIME]); } --- 168,172 ---- sub _loop_resume_timer { Gtk->idle_remove($_watcher_timer); ! loop_resume_time_watcher($kr_queue->get_next_priority()); } *************** *** 297,301 **** # Register the next timeout if there are events left. ! if (@$kr_events) { $_watcher_timer = Gtk->idle_add(\&_loop_resume_timer); } --- 273,277 ---- # Register the next timeout if there are events left. ! if ($kr_queue->get_item_count()) { $_watcher_timer = Gtk->idle_add(\&_loop_resume_timer); } Index: Poll.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel/Poll.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Poll.pm 21 Sep 2002 05:57:28 -0000 1.9 --- Poll.pm 24 Sep 2002 06:32:41 -0000 1.10 *************** *** 34,38 **** sub MINIMUM_POLL_TIMEOUT () { 0 } ! my ($kr_sessions, $kr_events, $kr_event_ids); my %poll_fd_masks; --- 34,38 ---- sub MINIMUM_POLL_TIMEOUT () { 0 } ! my ($kr_sessions, $kr_queue); my %poll_fd_masks; *************** *** 43,48 **** my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_events = $kernel->_get_kr_events_ref(); ! $kr_event_ids = $kernel->_get_kr_event_ids_ref(); %poll_fd_masks = (); --- 43,47 ---- my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_queue = $kernel->_get_kr_queue_ref(); %poll_fd_masks = (); *************** *** 59,66 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; --- 58,63 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; *************** *** 70,77 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; --- 67,72 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; *************** *** 84,90 **** $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, [ ], ! time(), __FILE__, __LINE__ ); } --- 79,84 ---- $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ); } *************** *** 103,110 **** $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, ! [ ], ! time() + 1, __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; --- 97,102 ---- $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time() + 1, $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; *************** *** 128,141 **** } - sub loop_resume_watching_child_signals { - $SIG{CHLD} = 'DEFAULT' if exists $SIG{CHLD}; - $SIG{CLD} = 'DEFAULT' if exists $SIG{CLD}; - $poe_kernel->_enqueue_event - ( $poe_kernel, $poe_kernel, - EN_SCPOLL, ET_SCPOLL, [ ], - time() + 1, __FILE__, __LINE__ - ) if keys(%$kr_sessions) > 1; - } - sub loop_ignore_signal { my $signal = shift; --- 120,123 ---- *************** *** 280,285 **** my $timeout; ! if (@$kr_events) { ! $timeout = $kr_events->[0]->[ST_TIME] - $now; $timeout = MINIMUM_POLL_TIMEOUT if $timeout < MINIMUM_POLL_TIMEOUT; } --- 262,267 ---- my $timeout; ! if ($kr_queue->get_item_count()) { ! $timeout = $kr_queue->get_next_priority() - $now; $timeout = MINIMUM_POLL_TIMEOUT if $timeout < MINIMUM_POLL_TIMEOUT; } *************** *** 294,316 **** ) ); - warn( '*** Event times: ' . - join( ', ', - map { sprintf('%d=%.4f', - $_->[ST_SEQ], $_->[ST_TIME] - $now - ) - } @$kr_events - ) . - "\n" - ); - } - - # Ensure that the event queue remains in time order. - if (ASSERT_EVENTS and @$kr_events) { - my $previous_time = $kr_events->[0]->[ST_TIME]; - foreach (@$kr_events) { - die "event $_->[ST_SEQ] is out of order" - if $_->[ST_TIME] < $previous_time; - $previous_time = $_->[ST_TIME]; - } } --- 276,279 ---- Index: Select.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel/Select.pm,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Select.pm 21 Sep 2002 05:57:28 -0000 1.31 --- Select.pm 24 Sep 2002 06:32:41 -0000 1.32 *************** *** 36,40 **** }; ! my ($kr_sessions, $kr_events, $kr_event_ids, $kr_filenos); # select() vectors. They're stored in an array so that the VEC_RD, --- 36,40 ---- }; ! my ($kr_sessions, $kr_queue, $kr_filenos); # select() vectors. They're stored in an array so that the VEC_RD, *************** *** 55,60 **** $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_events = $kernel->_get_kr_events_ref(); ! $kr_event_ids = $kernel->_get_kr_event_ids_ref(); $kr_filenos = $kernel->_get_kr_filenos_ref(); --- 55,59 ---- $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_queue = $kernel->_get_kr_queue_ref(); $kr_filenos = $kernel->_get_kr_filenos_ref(); *************** *** 90,97 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; --- 89,94 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; *************** *** 101,108 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; --- 98,103 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; *************** *** 115,121 **** $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, [ ], ! time(), __FILE__, __LINE__ ); } --- 110,115 ---- $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ); } *************** *** 134,141 **** $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, ! [ ], ! time() + 1, __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; --- 128,133 ---- $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time() + 1, $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; *************** *** 159,172 **** } - sub loop_resume_watching_child_signals { - $SIG{CHLD} = 'DEFAULT' if exists $SIG{CHLD}; - $SIG{CLD} = 'DEFAULT' if exists $SIG{CLD}; - $poe_kernel->_enqueue_event - ( $poe_kernel, $poe_kernel, - EN_SCPOLL, ET_SCPOLL, [ ], - time() + 1, __FILE__, __LINE__ - ) if keys(%$kr_sessions) > 1; - } - sub loop_ignore_signal { my $signal = shift; --- 151,154 ---- *************** *** 264,271 **** my $now = time(); ! my $timeout; ! if (@$kr_events) { ! $timeout = $kr_events->[0]->[ST_TIME] - $now; $timeout = MINIMUM_SELECT_TIMEOUT if $timeout < MINIMUM_SELECT_TIMEOUT; } --- 246,253 ---- my $now = time(); ! my $timeout = $kr_queue->get_next_priority(); ! if (defined $timeout) { ! $timeout -= $now; $timeout = MINIMUM_SELECT_TIMEOUT if $timeout < MINIMUM_SELECT_TIMEOUT; } *************** *** 280,302 **** ) ); - warn( '*** Event times: ' . - join( ', ', - map { sprintf('%d=%.4f', - $_->[ST_SEQ], $_->[ST_TIME] - $now - ) - } @$kr_events - ) . - "\n" - ); - } - - # Ensure that the event queue remains in time order. - if (ASSERT_EVENTS and @$kr_events) { - my $previous_time = $kr_events->[0]->[ST_TIME]; - foreach (@$kr_events) { - die "event $_->[ST_SEQ] is out of order" - if $_->[ST_TIME] < $previous_time; - $previous_time = $_->[ST_TIME]; - } } --- 262,265 ---- Index: Tk.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel/Tk.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Tk.pm 21 Sep 2002 05:57:28 -0000 1.28 --- Tk.pm 24 Sep 2002 06:32:41 -0000 1.29 *************** *** 33,37 **** my $_watcher_timer; ! my ($kr_sessions, $kr_events, $kr_filenos); #------------------------------------------------------------------------------ --- 33,37 ---- my $_watcher_timer; ! my ($kr_sessions, $kr_queue, $kr_filenos); #------------------------------------------------------------------------------ *************** *** 41,45 **** my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_events = $kernel->_get_kr_events_ref(); $kr_filenos = $kernel->_get_kr_filenos_ref(); --- 41,45 ---- my $kernel = shift; $kr_sessions = $kernel->_get_kr_sessions_ref(); ! $kr_queue = $kernel->_get_kr_queue_ref(); $kr_filenos = $kernel->_get_kr_filenos_ref(); *************** *** 59,66 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; --- 59,64 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing generic SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_generic; *************** *** 70,77 **** TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SIGNAL, ET_SIGNAL, ! [ $_[0] ], ! time(), __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; --- 68,73 ---- TRACE_SIGNALS and warn "\%\%\% Enqueuing PIPE-like SIG$_[0] event...\n"; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SIGNAL, ET_SIGNAL, [ $_[0] ], ! __FILE__, __LINE__ ); $SIG{$_[0]} = \&_loop_signal_handler_pipe; *************** *** 84,90 **** $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, [ ], ! time(), __FILE__, __LINE__ ); } --- 80,85 ---- $SIG{$_[0]} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time(), $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ); } *************** *** 103,109 **** $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( $poe_kernel, $poe_kernel, ! EN_SCPOLL, ET_SCPOLL, [ ], ! time() + 1, __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; --- 98,103 ---- $SIG{$signal} = 'DEFAULT'; $poe_kernel->_enqueue_event ! ( time() + 1, $poe_kernel, $poe_kernel, EN_SCPOLL, ET_SCPOLL, [ ], ! __FILE__, __LINE__ ) if $signal eq 'CHLD' or not exists $SIG{CHLD}; *************** *** 127,140 **** } - sub loop_resume_watching_child_signals () { - $SIG{CHLD} = 'DEFAULT' if exists $SIG{CHLD}; - $SIG{CLD} = 'DEFAULT' if exists $SIG{CLD}; - $poe_kernel->_enqueue_event - ( $poe_kernel, $poe_kernel, - EN_SCPOLL, ET_SCPOLL, [ ], - time() + 1, __FILE__, __LINE__ - ) if keys(%$kr_sessions) > 1; - } - sub loop_ignore_signal { my $signal = shift; --- 121,124 ---- *************** *** 322,326 **** # Register the next timed callback if there are events left. ! if (@$kr_events) { # Cancel the Tk alarm that handles alarms. --- 306,310 ---- # Register the next timed callback if there are events left. ! if ($kr_queue->get_item_count()) { # Cancel the Tk alarm that handles alarms. *************** *** 339,344 **** undef $_watcher_timer; ! if (@$kr_events) { ! my $next_time = $kr_events->[0]->[ST_TIME] - time(); $next_time = 0 if $next_time < 0; --- 323,328 ---- undef $_watcher_timer; ! if ($kr_queue->get_item_count()) { ! my $next_time = $kr_queue->get_next_priority() - time(); $next_time = 0 if $next_time < 0; *************** *** 358,362 **** # to 0. ! if (@$kr_events == 1) { test_for_idle_poe_kernel(); } --- 342,346 ---- # to 0. ! if ($kr_queue->get_item_count() == 1) { test_for_idle_poe_kernel(); } |