3 * Copyright 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 along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef INCLUDED_MB_RUNTIME_BASE_H
23 #define INCLUDED_MB_RUNTIME_BASE_H
25 #include <mblock/runtime.h>
26 #include <gnuradio/omnithread.h>
27 #include <mblock/time.h>
30 * \brief This is the runtime class used by the implementation.
32 class mb_runtime_base : public mb_runtime
34 omni_mutex d_brl; // big runtime lock (avoid using this if possible...)
37 mb_msg_accepter_sptr d_accepter;
42 * \brief lock the big runtime lock
45 inline void lock() { d_brl.lock(); }
48 * \brief unlock the big runtime lock
51 inline void unlock() { d_brl.unlock(); }
53 virtual void request_shutdown(pmt_t result);
55 virtual mb_mblock_sptr
56 create_component(const std::string &instance_name,
57 const std::string &class_name,
61 schedule_one_shot_timeout(const mb_time &abs_time, pmt_t user_data,
62 mb_msg_accepter_sptr accepter);
65 schedule_periodic_timeout(const mb_time &first_abs_time,
66 const mb_time &delta_time,
68 mb_msg_accepter_sptr accepter);
70 cancel_timeout(pmt_t handle);
73 accepter() { return d_accepter; }
78 #endif /* INCLUDED_MB_RUNTIME_BASE_H */