24 #ifndef __CORE_THREADING_THREAD_H_
25 #define __CORE_THREADING_THREAD_H_
27 #include <sys/types.h>
30 #define forever while (1)
38 class ThreadNotificationListener;
40 template <
typename Type>
class LockList;
75 void start(
bool wait=
true);
95 const char *
name()
const {
return __name; }
129 void set_name(const
char *format, ...);
142 Thread(const
char *name, pthread_t
id);
144 static
void * entry(
void * pthis);
145 void __constructor(const
char *name,
OpMode op_mode);
146 void notify_of_failed_init();
147 void notify_of_startup();
148 void lock_sleep_mutex();
150 static
void init_thread_key();
151 static
void set_tsd_thread_instance(
Thread *t);
153 pthread_t __thread_id;
156 mutable
Mutex *__sleep_mutex;
158 unsigned int __pending_wakeups;
162 Mutex *__loop_done_mutex;
166 Mutex *__prepfin_hold_mutex;
172 bool __waiting_for_wakeup;
173 bool __delete_on_exit;
178 bool __prepfin_conc_loop;
179 bool __coalesce_wakeups;
185 static pthread_key_t THREAD_KEY;
186 static pthread_key_t MAIN_THREAD_KEY;
187 static pthread_mutex_t __thread_key_mutex;