3 * Copyright (C) 2001-2003 William E. Kempf
4 * Copyright (C) 2007 Anthony Williams
5 * Copyright 2008,2009 Free Software Foundation, Inc.
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)
12 * This was extracted from Boost 1.35.0 and fixed.
15 #ifndef INCLUDED_GRUEL_THREAD_GROUP_H
16 #define INCLUDED_GRUEL_THREAD_GROUP_H
18 #include <gruel/thread.h>
19 #include <boost/utility.hpp>
20 #include <boost/thread/shared_mutex.hpp>
21 #include <boost/function.hpp>
25 class thread_group : public boost::noncopyable
31 boost::thread* create_thread(const boost::function0<void>& threadfunc);
32 void add_thread(boost::thread* thrd);
33 void remove_thread(boost::thread* thrd);
39 std::list<boost::thread*> m_threads;
40 mutable boost::shared_mutex m_mutex;
44 #endif /* INCLUDED_GRUEL_THREAD_GROUP_H */