[Neo-report] r2025 gregory - /trunk/neo/event.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 26 10:04:10 CEST 2010
Author: gregory
Date: Mon Apr 26 10:04:09 2010
New Revision: 2025
Log:
Lock the connection before processing pending packets.
Modified:
trunk/neo/event.py
Modified: trunk/neo/event.py
==============================================================================
--- trunk/neo/event.py [iso-8859-1] (original)
+++ trunk/neo/event.py [iso-8859-1] Mon Apr 26 10:04:09 2010
@@ -91,13 +91,17 @@
# See if there is anything to process
to_process = self._getPendingConnection()
if to_process is not None:
+ to_process.lock()
try:
- # Process
- to_process.process()
+ try:
+ # Process
+ to_process.process()
+ finally:
+ # ...and requeue if there are pending messages
+ if to_process.hasPendingMessages():
+ self._addPendingConnection(to_process)
finally:
- # ...and requeue if there are pending messages
- if to_process.hasPendingMessages():
- self._addPendingConnection(to_process)
+ to_process.unlock()
def _poll(self, timeout=1):
rlist, wlist, elist = self.epoll.poll(timeout)
More information about the Neo-report
mailing list