[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/05: runtime: fix deadlock in unlock() fr
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/05: runtime: fix deadlock in unlock() from Python #594 |
Date: |
Sat, 4 Apr 2015 17:39:30 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 7b7c3363afbb97e6641b469d2bea69941a24839c
Author: Jiří Pinkava <address@hidden>
Date: Thu Mar 12 08:54:22 2015 +0100
runtime: fix deadlock in unlock() from Python #594
---
gnuradio-runtime/python/gnuradio/gr/top_block.py | 8 +++++++-
gnuradio-runtime/swig/top_block.i | 8 ++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/gnuradio-runtime/python/gnuradio/gr/top_block.py
b/gnuradio-runtime/python/gnuradio/gr/top_block.py
index f9872fc..f449d98 100644
--- a/gnuradio-runtime/python/gnuradio/gr/top_block.py
+++ b/gnuradio-runtime/python/gnuradio/gr/top_block.py
@@ -22,7 +22,7 @@
from runtime_swig import top_block_swig, \
top_block_wait_unlocked, top_block_run_unlocked, \
top_block_start_unlocked, top_block_stop_unlocked, \
- dot_graph_tb
+ top_block_unlock_unlocked, dot_graph_tb
#import gnuradio.gr.gr_threading as _threading
import gr_threading as _threading
@@ -118,6 +118,12 @@ class top_block(hier_block2):
self.start(max_noutput_items)
self.wait()
+ def unlock(self):
+ """
+ Release lock and continue execution of flow-graph.
+ """
+ top_block_unlock_unlocked(self._impl)
+
def wait(self):
"""
Wait for the flowgraph to finish running
diff --git a/gnuradio-runtime/swig/top_block.i
b/gnuradio-runtime/swig/top_block.i
index 60c9e1a..c7ee0af 100644
--- a/gnuradio-runtime/swig/top_block.i
+++ b/gnuradio-runtime/swig/top_block.i
@@ -89,6 +89,14 @@ void top_block_stop_unlocked(gr::top_block_sptr r) throw
(std::runtime_error)
)
}
+void top_block_unlock_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
+{
+ GR_PYTHON_BLOCKING_CODE
+ (
+ r->unlock();
+ )
+}
+
std::string
dot_graph_tb(gr::top_block_sptr r)
{