diff options
author | jcorgan | 2007-11-02 03:02:56 +0000 |
---|---|---|
committer | jcorgan | 2007-11-02 03:02:56 +0000 |
commit | 6b1dcc7d74acf86d755de4668ad7b136ed3748be (patch) | |
tree | 2bc1208c4ca005762c9be434c534d7de3a92adc0 /gnuradio-core/src/lib | |
parent | a65493f9255903f790d128217b8254736b37d5ba (diff) | |
download | gnuradio-6b1dcc7d74acf86d755de4668ad7b136ed3748be.tar.gz gnuradio-6b1dcc7d74acf86d755de4668ad7b136ed3748be.tar.bz2 gnuradio-6b1dcc7d74acf86d755de4668ad7b136ed3748be.zip |
Merged r6780:6781 from jcorgan/t196. Fixes ticket:196.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6782 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_top_block.i | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index 78c2e0b95..4eb9db636 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -49,25 +49,18 @@ public: bool is_running(); }; -%{ -class ensure_py_gil_state2 { - PyGILState_STATE d_gstate; -public: - ensure_py_gil_state2() { d_gstate = PyGILState_Ensure(); } - ~ensure_py_gil_state2() { PyGILState_Release(d_gstate); } -}; -%} - %inline %{ void top_block_run_unlocked(gr_top_block_sptr r) throw (std::runtime_error) { - ensure_py_gil_state2 _lock; + Py_BEGIN_ALLOW_THREADS; // release global interpreter lock r->run(); + Py_END_ALLOW_THREADS; // acquire global interpreter lock } void top_block_wait_unlocked(gr_top_block_sptr r) throw (std::runtime_error) { - ensure_py_gil_state2 _lock; + Py_BEGIN_ALLOW_THREADS; // release global interpreter lock r->wait(); + Py_END_ALLOW_THREADS; // acquire global interpreter lock } %} |