GNU Radio Manual and C++ API Reference  3.8.2.0
The Free & Open Software Radio Ecosystem
thread_group.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright (C) 2001-2003 William E. Kempf
4  * Copyright (C) 2007 Anthony Williams
5  * Copyright 2008,2009 Free Software Foundation, Inc.
6  *
7  * Distributed under the Boost Software License, Version 1.0. (See accompanying
8  * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9  */
10 
11 /*
12  * This was extracted from Boost 1.35.0 and fixed.
13  */
14 
15 #ifndef INCLUDED_THREAD_GROUP_H
16 #define INCLUDED_THREAD_GROUP_H
17 
18 #include <gnuradio/api.h>
19 #include <gnuradio/thread/thread.h>
20 #include <boost/function.hpp>
21 #include <boost/thread/shared_mutex.hpp>
22 #include <boost/utility.hpp>
23 
24 namespace gr {
25 namespace thread {
26 
27 class GR_RUNTIME_API thread_group : public boost::noncopyable
28 {
29 public:
32 
33  boost::thread* create_thread(const boost::function0<void>& threadfunc);
36  void join_all();
37  void interrupt_all();
38  size_t size() const;
39 
40 private:
41  std::list<boost::thread*> m_threads;
42  mutable boost::shared_mutex m_mutex;
43 };
44 
45 } /* namespace thread */
46 } /* namespace gr */
47 
48 #endif /* INCLUDED_THREAD_GROUP_H */
gr::thread::thread_group::size
size_t size() const
gr::thread::thread_group::add_thread
void add_thread(boost::thread *thrd)
gr::thread::thread_group::join_all
void join_all()
gr::thread::thread_group
Definition: thread_group.h:28
gr::thread::thread_group::~thread_group
~thread_group()
gr::thread::thread_group::interrupt_all
void interrupt_all()
GR_RUNTIME_API
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
gr::thread::thread_group::create_thread
boost::thread * create_thread(const boost::function0< void > &threadfunc)
api.h
gr::thread::thread
boost::thread thread
Definition: thread.h:47
gr
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
gr::thread::thread_group::thread_group
thread_group()
gr::thread::thread_group::remove_thread
void remove_thread(boost::thread *thrd)
thread.h