summaryrefslogtreecommitdiff
path: root/python/qpid/session.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-06-16 23:25:01 +0000
committerRafael H. Schloming <rhs@apache.org>2008-06-16 23:25:01 +0000
commit3f23de2976509220a588be4a69469c9ee70e0789 (patch)
tree223d9c746a9d7e33ea8a2f103c95870264eccf92 /python/qpid/session.py
parent70a2a643f61aa1450fcdc0f754870301e29b3553 (diff)
downloadqpid-python-3f23de2976509220a588be4a69469c9ee70e0789.tar.gz
QPID-1142: made session.sync() always set the sync flag on execution_sync
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@668344 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/session.py')
-rw-r--r--python/qpid/session.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/python/qpid/session.py b/python/qpid/session.py
index 3d8c0aa7fd..2f70461ab6 100644
--- a/python/qpid/session.py
+++ b/python/qpid/session.py
@@ -91,10 +91,11 @@ class Session(Invoker):
return tuple(exc)
def sync(self, timeout=None):
- if currentThread() == self.channel.connection.thread:
+ ch = self.channel
+ if ch is not None and currentThread() == ch.connection.thread:
raise SessionException("deadlock detected")
if not self.auto_sync:
- self.execution_sync()
+ self.execution_sync(sync=True)
last = self.sender.next_id - 1
if not wait(self.condition, lambda:
last in self.sender._completed or self.exceptions,
@@ -174,10 +175,11 @@ class Session(Invoker):
else:
message = None
+ hdr = Struct(self.spec["session.header"])
+ hdr.sync = self.auto_sync or kwargs.pop("sync", False)
+
cmd = type.new(args, kwargs)
sc = StringCodec(self.spec)
- hdr = Struct(self.spec["session.header"])
- hdr.sync = self.auto_sync
sc.write_command(hdr, cmd)
seg = Segment(True, (message == None or