From 8dc057a70e33638bd86b3a5a76a2963746336488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Borgstr=C3=B6m?= Date: Sat, 30 Jul 2011 22:51:16 +0200 Subject: [PATCH] Remove potential busy wait for remote stores --- darc/remote.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darc/remote.py b/darc/remote.py index b3fe7b35e..1d31186ff 100644 --- a/darc/remote.py +++ b/darc/remote.py @@ -108,9 +108,9 @@ def __init__(self, location, create=False): self.msgid = 0 self.id, self.tid = self.cmd('open', (location.path, create)) - def wait(self): + def wait(self, write=True): with self.channel.lock: - if (self.channel.out_window_size == 0 and + if ((not write or self.channel.out_window_size == 0) and not self.channel.recv_ready() and not self.channel.recv_stderr_ready()): self.channel.out_buffer_cv.wait(10) @@ -145,7 +145,7 @@ def cmd(self, cmd, args, callback=None, callback_data=None): if not odata and callback: return else: - self.wait() + self.wait(odata) def commit(self, *args): self.cmd('commit', args)