You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2009/06/02 16:24:03 UTC

svn commit: r781043 - /qpid/trunk/qpid/python/qpid/session.py

Author: rhs
Date: Tue Jun  2 14:24:03 2009
New Revision: 781043

URL: http://svn.apache.org/viewvc?rev=781043&view=rev
Log:
only sync when we need to

Modified:
    qpid/trunk/qpid/python/qpid/session.py

Modified: qpid/trunk/qpid/python/qpid/session.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/session.py?rev=781043&r1=781042&r2=781043&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/session.py (original)
+++ qpid/trunk/qpid/python/qpid/session.py Tue Jun  2 14:24:03 2009
@@ -49,6 +49,7 @@
   def __init__(self, name, auto_sync=True, timeout=10, delegate=client):
     self.name = name
     self.auto_sync = auto_sync
+    self.need_sync = True
     self.timeout = timeout
     self.channel = None
     self.invoke_lock = Lock()
@@ -94,7 +95,7 @@
     ch = self.channel
     if ch is not None and currentThread() == ch.connection.thread:
       raise SessionException("deadlock detected")
-    if not self.auto_sync:
+    if self.need_sync:
       self.execution_sync(sync=True)
     last = self.sender.next_id - 1
     if not wait(self.condition, lambda:
@@ -162,6 +163,7 @@
 
     hdr = Struct(self.spec["session.header"])
     hdr.sync = self.auto_sync or kwargs.pop("sync", False)
+    self.need_sync = not hdr.sync
 
     cmd = type.new(args, kwargs)
     sc = StringCodec(self.spec)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org