21 #ifndef INCLUDE_OLA_THREAD_THREAD_H_
22 #define INCLUDE_OLA_THREAD_THREAD_H_
28 #define WIN32_LEAN_AND_MEAN
32 #include <ola/thread/Mutex.h>
36 #if defined(_WIN32) && defined(__GNUC__)
37 inline bool operator==(
const ptw32_handle_t &left,
38 const ptw32_handle_t &right) {
39 return (left.p == right.p) && (left.x == right.x);
42 inline std::ostream&
operator<<(std::ostream &stream,
43 const ptw32_handle_t &handle) {
52 typedef pthread_t ThreadId;
120 virtual bool Start();
136 virtual bool Join(
void *ptr = NULL);
151 ThreadId
Id()
const {
return m_thread_id; }
160 std::string
Name()
const {
return m_options.
name; }
166 void* _InternalRun();
172 static inline ThreadId
Self() {
return pthread_self(); }
181 virtual void *
Run() = 0;
184 pthread_t m_thread_id;
190 DISALLOW_COPY_AND_ASSIGN(
Thread);
194 #endif // INCLUDE_OLA_THREAD_THREAD_H_