Commit 0c744101 authored by Jim Fulton's avatar Jim Fulton

Changed the way that the storage is closed. Our close method may be

called from a separate thread than the async main loop. We only want
the async main loop to close our _call (rpc) object. Instead of
closing it directly, we call closeIntensionally(), which, in return,
requests that the async main loop closes it, via the select trigger.
parent 90d90a12
......@@ -85,7 +85,7 @@
"""Simple rpc mechanisms
"""
__version__ = "$Revision: 1.6 $"[11:-2]
__version__ = "$Revision: 1.7 $"[11:-2]
from cPickle import loads
from thread import allocate_lock
......@@ -240,6 +240,11 @@ class asyncRPC(SizedMessageAsyncConnection):
def _read(self):
self.__la()
return self.__r
def closeIntensionally(self):
if self.__map:
self.__Wakeup(lambda self=self: self.close()) # You dumb bastard
else: self.close()
def close(self):
asyncRPC.inheritedAttribute('close')(self)
......
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