From 9027abc0c2a905c85387ad8f2ffed487ee9efffc Mon Sep 17 00:00:00 2001 From: negasora Date: Mon, 1 Oct 2018 12:09:30 -0400 Subject: Patch FlowGraph locking --- python/flowgraph.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'python') diff --git a/python/flowgraph.py b/python/flowgraph.py index 4d551c83..79351838 100644 --- a/python/flowgraph.py +++ b/python/flowgraph.py @@ -554,8 +554,6 @@ class FlowGraph(object): return FlowGraphLayoutRequest(self, callback) def _wait_complete(self): - self._wait_cond.acquire() - self._wait_cond.notify() self._wait_cond.release() def layout_and_wait(self): @@ -566,12 +564,13 @@ class FlowGraph(object): Do not use this API on the UI thread (use ``layout`` with a callback instead). """ - self._wait_cond = threading.Condition() + self._wait_cond = threading.Lock() + + self._wait_cond.acquire() + request = self.layout(self._wait_complete) self._wait_cond.acquire() - while not request.complete: - self._wait_cond.wait() self._wait_cond.release() def get_nodes_in_region(self, left, top, right, bottom): -- cgit v1.3.1