Author: tack
Date: Tue May 8 22:38:50 2007
New Revision: 2673
Modified:
trunk/base/src/notifier/pynotifier/dispatch.py
trunk/base/src/notifier/pynotifier/nf_generic.py
Log:
If there are no timers and no dispatchers, there is no sense in waking up
every 100ms. (This patch should be tested and then submitted upstream if
it's ok.)
Modified: trunk/base/src/notifier/pynotifier/dispatch.py
==============================================================================
--- trunk/base/src/notifier/pynotifier/dispatch.py (original)
+++ trunk/base/src/notifier/pynotifier/dispatch.py Tue May 8 22:38:50 2007
@@ -56,3 +56,6 @@
for disp in copy( __dispatchers ):
if not disp():
dispatcher_remove( disp )
+
+def dispatcher_count():
+ return len(__dispatchers)
Modified: trunk/base/src/notifier/pynotifier/nf_generic.py
==============================================================================
--- trunk/base/src/notifier/pynotifier/nf_generic.py (original)
+++ trunk/base/src/notifier/pynotifier/nf_generic.py Tue May 8 22:38:50 2007
@@ -189,7 +189,12 @@
else:
timeout = 0
break
- if timeout == None: timeout = dispatch.MIN_TIMER
+ if timeout == None:
+ if dispatch.dispatcher_count():
+ timeout = dispatch.MIN_TIMER
+ else:
+ # No timers and no dispatchers, timeout
could be infinity.
+ timeout = 30000
if __min_timer and __min_timer < timeout: timeout =
__min_timer
r = w = e = ()
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog