Commit d04c53f2 authored by Vincent Pelletier's avatar Vincent Pelletier

Revert commit 254: super(MTClientConnection, self).__init__ sends self to...

Revert commit 254: super(MTClientConnection, self).__init__ sends self to event_manager, which registers it to epoll, and epoll_wait is pending in another thread. So this lock is really needed.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@289 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent c619ca8d
......@@ -358,7 +358,11 @@ class MTClientConnection(ClientConnection):
self._lock = lock = RLock()
self.acquire = lock.acquire
self.release = lock.release
super(MTClientConnection, self).__init__(*args, **kwargs)
try:
self.lock()
super(MTClientConnection, self).__init__(*args, **kwargs)
finally:
self.unlock()
def lock(self, blocking = 1):
return self.acquire(blocking = blocking)
......@@ -405,7 +409,11 @@ class MTServerConnection(ServerConnection):
self._lock = lock = RLock()
self.acquire = lock.acquire
self.release = lock.release
super(MTServerConnection, self).__init__(*args, **kwargs)
try:
self.lock()
super(MTServerConnection, self).__init__(*args, **kwargs)
finally:
self.unlock()
def lock(self, blocking = 1):
return self.acquire(blocking = blocking)
......
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