[Zodb-checkins] CVS: StandaloneZODB/ZEO - ClientStorage.py:1.48

Tim Peters tim.one@comcast.net
Fri, 16 Aug 2002 17:58:21 -0400


Update of /cvs-repository/StandaloneZODB/ZEO
In directory cvs.zope.org:/tmp/cvs-serv31300/ZEO

Modified Files:
	ClientStorage.py 
Log Message:
ClientStorage:
_basic_init():  repair tpc_cond comments in light of recent changes.
tpc_begin:  when self._server is None, do tpc_cond.notify() to let
other threads waiting for "_transaction is None" to continue.


=== StandaloneZODB/ZEO/ClientStorage.py 1.47 => 1.48 ===
--- StandaloneZODB/ZEO/ClientStorage.py:1.47	Fri Aug 16 17:42:49 2002
+++ StandaloneZODB/ZEO/ClientStorage.py	Fri Aug 16 17:58:21 2002
@@ -114,12 +114,12 @@
         self.__name__ = name
 
         # A ClientStorage only allows one client to commit at a time.
-        # Mutual exclusion is achieved using tpc_cond(), which
+        # Mutual exclusion is achieved using tpc_cond, which
         # protects _transaction.  A thread that wants to assign to
-        # self._transaction must acquire tpc_cond() first.
-
-        # Invariant: If self._transaction is not None, then tpc_cond()
-        # must be acquired.
+        # self._transaction must acquire tpc_cond first.  A thread
+        # that decides it's done with a transaction (whether via success
+        # or failure) must set _transaction to None and do
+        # tpc_cond.notify() before releasing tpc_cond..
         self.tpc_cond = threading.Condition()
         self._transaction = None
 
@@ -352,6 +352,7 @@
             # XXX we would have stayed in the while loop.
             assert self._transaction is None
             self._transaction = None
+            self.tpc_cond.notify()
             self.tpc_cond.release()
             raise ClientDisconnected()