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

Barry Warsaw barry@wooz.org
Wed, 15 May 2002 01:16:27 -0400


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

Modified Files:
      Tag: ZEO2-branch
	ClientStorage.py 
Log Message:
tpc_begin(): Add a comment explaining why the release of the tpc_cond
lock is safe.


=== ZEO/ZEO/ClientStorage.py 1.35.6.4.2.4 => 1.35.6.4.2.5 ===
         while self._transaction is not None:
             if self._transaction == transaction:
+                # Our tpc_cond lock is re-entrant.  It is allowable for a
+                # client to call two tpc_begins in a row with the same
+                # transaction, and the second of these must be ignored.  Our
+                # locking is safe because the acquire() above gives us a
+                # second lock on tpc_cond, and the following release() brings
+                # us back to owning just the one tpc_cond lock (acquired
+                # during the first of two consecutive tpc_begins).
                 self.tpc_cond.release()
                 return
             self.tpc_cond.wait()