00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef THREADDUMMYIMPL_H
00020 #define THREADDUMMYIMPL_H
00021
00022 #include "pandabase.h"
00023 #include "selectThreadImpl.h"
00024
00025 #ifdef THREAD_DUMMY_IMPL
00026
00027 #include "notify.h"
00028 #include "threadPriority.h"
00029 #include "pmutex.h"
00030
00031 #include <prthread.h>
00032
00033 class Thread;
00034
00035
00036
00037 #ifdef atomic_set
00038 #undef atomic_set
00039 #endif
00040
00041
00042
00043
00044
00045
00046
00047 class EXPCL_PANDAEXPRESS ThreadDummyImpl {
00048 public:
00049 INLINE ThreadDummyImpl(Thread *parent_obj);
00050 INLINE ~ThreadDummyImpl();
00051
00052 INLINE bool start(ThreadPriority priority, bool global, bool joinable);
00053 INLINE void join();
00054
00055 INLINE static void prepare_for_exit();
00056
00057 INLINE static Thread *get_current_thread();
00058 INLINE static bool is_threading_supported();
00059 INLINE static void sleep(double seconds);
00060
00061 INLINE int atomic_inc(int &var);
00062 INLINE int atomic_dec(int &var);
00063 INLINE int atomic_set(int &var, int new_value);
00064 };
00065
00066 #include "threadDummyImpl.I"
00067
00068 #endif // THREAD_DUMMY_IMPL
00069
00070 #endif