summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-06-02 14:24:03 +0000
committerRafael H. Schloming <rhs@apache.org>2009-06-02 14:24:03 +0000
commit7b4ced5276092feb0a1a5f1f8b8945a683aa017e (patch)
treeffce3c532904e6d129214b8f76876be84c48a494 /qpid/python
parent11f7bdd655e5e6124add684db05273b667f67974 (diff)
downloadqpid-python-7b4ced5276092feb0a1a5f1f8b8945a683aa017e.tar.gz
only sync when we need to
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@781043 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/session.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/qpid/python/qpid/session.py b/qpid/python/qpid/session.py
index 587a226aa1..3b8bd18469 100644
--- a/qpid/python/qpid/session.py
+++ b/qpid/python/qpid/session.py
@@ -49,6 +49,7 @@ class Session(command_invoker(SPEC)):
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 @@ class Session(command_invoker(SPEC)):
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 @@ class Session(command_invoker(SPEC)):
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)