3 * Copyright 2004,2006,2007 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
24 typedef boost::shared_ptr<gr_runtime> gr_runtime_sptr;
25 %template(gr_runtime_sptr) boost::shared_ptr<gr_runtime>;
27 gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block);
32 gr_runtime(gr_hier_block2_sptr top_block);
35 void run() throw (std::runtime_error);
36 void start() throw (std::runtime_error);
37 void stop() throw (std::runtime_error);
38 void wait() throw (std::runtime_error);
39 void restart() throw (std::runtime_error);
43 class ensure_py_gil_state2 {
44 PyGILState_STATE d_gstate;
46 ensure_py_gil_state2() { d_gstate = PyGILState_Ensure(); }
47 ~ensure_py_gil_state2() { PyGILState_Release(d_gstate); }
52 void runtime_run_unlocked(gr_runtime_sptr r) throw (std::runtime_error)
54 ensure_py_gil_state2 _lock;
58 void runtime_start_unlocked(gr_runtime_sptr r) throw (std::runtime_error)
60 ensure_py_gil_state2 _lock;
64 void runtime_stop_unlocked(gr_runtime_sptr r) throw (std::runtime_error)
66 ensure_py_gil_state2 _lock;
70 void runtime_wait_unlocked(gr_runtime_sptr r) throw (std::runtime_error)
72 ensure_py_gil_state2 _lock;
76 void runtime_restart_unlocked(gr_runtime_sptr r) throw (std::runtime_error)
78 ensure_py_gil_state2 _lock;