summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornegasora <negasora@gmail.com>2018-10-01 12:09:30 -0400
committerPeter LaFosse <peter@vector35.com>2018-10-05 14:46:17 -0400
commit9027abc0c2a905c85387ad8f2ffed487ee9efffc (patch)
tree892a4f62f0a77dfa4f94a7048cc5e9b3977f9e67
parentd915ceecc4285c4a07ce02a70346254aa713073c (diff)
Patch FlowGraph locking
-rw-r--r--python/flowgraph.py9
1 files changed, 4 insertions, 5 deletions
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):