gr-baz Package
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_GRUEL_THREAD_GROUP_H
16
#define INCLUDED_GRUEL_THREAD_GROUP_H
17
18
#include <
gruel/api.h
>
19
#include <
gruel/thread.h
>
20
#include <boost/utility.hpp>
21
#include <boost/thread/shared_mutex.hpp>
22
#include <boost/function.hpp>
23
24
namespace
gruel
25
{
26
class
GRUEL_API
thread_group
:
public
boost::noncopyable
27
{
28
public
:
29
thread_group
();
30
~
thread_group
();
31
32
boost::thread
* create_thread(
const
boost::function0<void>& threadfunc);
33
void
add_thread(
boost::thread
* thrd);
34
void
remove_thread(
boost::thread
* thrd);
35
void
join_all();
36
void
interrupt_all();
37
size_t
size()
const
;
38
39
private
:
40
std::list<boost::thread*> m_threads;
41
mutable
boost::shared_mutex m_mutex;
42
};
43
}
44
45
#endif
/* INCLUDED_GRUEL_THREAD_GROUP_H */
gnuradio
gruel
src
include
gruel
thread_group.h
Generated by
1.8.1.1