15 #ifndef THREADPOSIXIMPL_H
16 #define THREADPOSIXIMPL_H
18 #include "pandabase.h"
19 #include "selectThreadImpl.h"
21 #ifdef THREAD_POSIX_IMPL
24 #include "threadPriority.h"
25 #include "mutexPosixImpl.h"
35 class EXPCL_PANDA_PIPELINE ThreadPosixImpl {
37 INLINE ThreadPosixImpl(
Thread *parent_obj);
40 void setup_main_thread();
41 bool start(ThreadPriority priority,
bool joinable);
43 INLINE
void preempt();
45 string get_unique_id()
const;
47 INLINE
static void prepare_for_exit();
49 INLINE
static Thread *get_current_thread();
50 INLINE
static void bind_thread(
Thread *thread);
51 INLINE
static bool is_threading_supported();
52 INLINE
static bool is_true_threads();
53 INLINE
static bool is_simple_threads();
54 INLINE
static void sleep(
double seconds);
55 INLINE
static void yield();
56 INLINE
static void consider_yield();
59 static void *root_func(
void *data);
60 static void init_pt_ptr_index();
70 MutexPosixImpl _mutex;
77 static pthread_key_t _pt_ptr_index;
78 static bool _got_pt_ptr_index;
81 #include "threadPosixImpl.I"
83 #endif // THREAD_POSIX_IMPL
A thread; that is, a lightweight process.