Thread: [poe-commits] SF.net SVN: poe: [2341] trunk/poe/lib/POE/Loop/Select.pm
Brought to you by:
rcaputo
From: <rc...@us...> - 2008-05-29 06:02:11
|
Revision: 2341 http://poe.svn.sourceforge.net/poe/?rev=2341&view=rev Author: rcaputo Date: 2008-05-28 23:02:19 -0700 (Wed, 28 May 2008) Log Message: ----------- Eliminate a call to get_next_event_time(). Modified Paths: -------------- trunk/poe/lib/POE/Loop/Select.pm Modified: trunk/poe/lib/POE/Loop/Select.pm =================================================================== --- trunk/poe/lib/POE/Loop/Select.pm 2008-05-29 05:57:52 UTC (rev 2340) +++ trunk/poe/lib/POE/Loop/Select.pm 2008-05-29 06:02:19 UTC (rev 2341) @@ -83,18 +83,23 @@ } #------------------------------------------------------------------------------ -# Maintain time watchers. +# Maintain time watchers. For this loop, we simply save the next +# event time in a scalar. loop_do_timeslice() will use the saved +# value. A "paused" time watcher is just a timeout for some future +# time. +my $_next_event_time = time(); + sub loop_resume_time_watcher { - # does nothing ($_[0] == next time) + $_next_event_time = shift; } sub loop_reset_time_watcher { - # does nothing ($_[0] == next time) + $_next_event_time = shift; } sub loop_pause_time_watcher { - # does nothing + $_next_event_time = time() + 3600; } #------------------------------------------------------------------------------ @@ -155,7 +160,7 @@ # event, if there are any. If nothing is waiting, set the timeout # for some constant number of seconds. - my $timeout = $self->get_next_event_time(); + my $timeout = $_next_event_time; my $now = time(); if (defined $timeout) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rc...@us...> - 2008-06-20 02:02:48
|
Revision: 2354 http://poe.svn.sourceforge.net/poe/?rev=2354&view=rev Author: rcaputo Date: 2008-06-19 19:02:56 -0700 (Thu, 19 Jun 2008) Log Message: ----------- Apply Tony Cook's patch to fix the updated time watcher methods. Avoids a nasty loop spin when there are no pending events. Modified Paths: -------------- trunk/poe/lib/POE/Loop/Select.pm Modified: trunk/poe/lib/POE/Loop/Select.pm =================================================================== --- trunk/poe/lib/POE/Loop/Select.pm 2008-06-18 13:13:12 UTC (rev 2353) +++ trunk/poe/lib/POE/Loop/Select.pm 2008-06-20 02:02:56 UTC (rev 2354) @@ -91,11 +91,11 @@ my $_next_event_time = time(); sub loop_resume_time_watcher { - $_next_event_time = shift; + $_next_event_time = $_[1]; } sub loop_reset_time_watcher { - $_next_event_time = shift; + $_next_event_time = $_[1]; } sub loop_pause_time_watcher { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |