00001 #line 233 "./lpsrc/flx_pthread.pak"
00002 #ifndef __FLX_THREAD__
00003 #define __FLX_THREAD__
00004 #include <flx_pthread_config.hpp>
00005
00006 #ifdef _WIN32
00007 #include <windows.h>
00008 #else
00009 #include <pthread.h>
00010 #endif
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 namespace flx { namespace pthread {
00021
00022
00023
00024
00025
00026
00027 class PTHREAD_EXTERN flx_detached_thread_t {
00028 #ifdef _WIN32
00029 HANDLE thread;
00030 #else
00031 pthread_t thr;
00032 #endif
00033 flx_detached_thread_t(flx_detached_thread_t const&);
00034 void operator=(flx_detached_thread_t const&);
00035 public:
00036 flx_detached_thread_t();
00037 ~flx_detached_thread_t();
00038 #ifdef _WIN32
00039 int init(LPTHREAD_START_ROUTINE, LPVOID lParam);
00040 #else
00041 int init(void* (*start)(void*), void* udat);
00042 #endif
00043 };
00044
00045 class PTHREAD_EXTERN flx_thread_t {
00046 #ifdef _WIN32
00047 HANDLE thread;
00048 #else
00049 pthread_t thr;
00050 #endif
00051 flx_thread_t(flx_thread_t const&);
00052 void operator=(flx_thread_t const&);
00053 public:
00054 flx_thread_t();
00055 ~flx_thread_t();
00056 #ifdef _WIN32
00057 int init(LPTHREAD_START_ROUTINE, LPVOID lParam);
00058 #else
00059 int init(void* (*start)(void*), void* udat);
00060 #endif
00061 void join();
00062 };
00063
00064
00065 class PTHREAD_EXTERN flx_thread_wrapper_t {
00066 flx_thread_t thread;
00067 flx_thread_wrapper_t(flx_thread_wrapper_t const&);
00068 void operator=(flx_thread_wrapper_t const&);
00069 public:
00070 ~flx_thread_wrapper_t();
00071 #ifndef _WIN32
00072 flx_thread_wrapper_t(void* (*start)(void*), void* udat);
00073 #else
00074 flx_thread_wrapper_t(LPTHREAD_START_ROUTINE, LPVOID);
00075 #endif
00076 };
00077
00078 }}
00079 #endif
00080