diff options
author | Rafael H. Schloming <rhs@apache.org> | 2009-06-02 14:24:03 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2009-06-02 14:24:03 +0000 |
commit | 2c65d1b1024b035d46fcfa9c67c84d54f0d68cc7 (patch) | |
tree | f8aca0a153659f00302804e2f9653f4c661bde72 | |
parent | ba07eba2031f9173855e7e6b2285a071a0d8171b (diff) | |
download | qpid-python-2c65d1b1024b035d46fcfa9c67c84d54f0d68cc7.tar.gz |
only sync when we need to
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@781043 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | python/qpid/session.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/qpid/session.py b/python/qpid/session.py index 587a226aa1..3b8bd18469 100644 --- a/python/qpid/session.py +++ b/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) |