summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authornegasora <negasora@gmail.com>2018-10-01 12:09:30 -0400
committernegasora <negasora@gmail.com>2018-10-03 14:58:20 -0400
commit208333f896ba722072245c89d6bf2c919602b74b (patch)
tree1d42821e64ffc65e4dead27fb7c7dbcc7af5c386 /python
parentbd0215667a465dc23b4d0949fd8457d7e6411fd7 (diff)
Patch FlowGraph locking
Diffstat (limited to 'python')
-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):