0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Thread.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 3
9  * of the License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Hypertable. If not, see <http://www.gnu.org/licenses/>
18  */
19 
25 #ifndef HYPERTABLE_THREAD_H
26 #define HYPERTABLE_THREAD_H
27 
28 #include <boost/thread.hpp>
29 #include "Common/Logger.h"
30 
31 namespace Hypertable {
32 
37 #ifdef BOOST_HAS_PTHREADS
38 # define HT_THREAD_ID_DECL(_var_) pthread_t _var_
39 # define HT_THREAD_ID_SET(_var_) _var_ = pthread_self()
40 #else
41 # define HT_THREAD_ID_DECL(_var_)
42 # define HT_THREAD_ID_SET(_var_)
43 #endif
44 
45 typedef boost::thread Thread;
46 typedef boost::thread_group ThreadGroup;
47 
48 namespace ThisThread {
49  using namespace boost::this_thread;
50 }
51 
54 } // namespace Hypertable
55 
56 #endif // HYPERTABLE_THREAD_H
boost::thread_group ThreadGroup
Definition: Thread.h:46
Logging routines and macros.
Hypertable definitions
boost::thread Thread
Definition: Thread.h:45