Commit c3d6e9a4 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Lock the connection before processing pending packets.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2025 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 8e8d61d1
......@@ -91,13 +91,17 @@ class EpollEventManager(object):
# 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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment