22 #ifndef _SPRINT_THREAD_FUNCTION_H
23 #define _SPRINT_THREAD_FUNCTION_H
40 struct thread_function {
44 typedef DWORD ReturnType;
46 typedef void * ParamType;
57 thread_function(
CallBackType _proc, ParamType _param) : proc(_proc), param(_param) { }
63 template<
class R, R (*Func)()>
64 DWORD __stdcall CALLBACK embedded_ptr_fun(
void *__Unused)
70 template<
class R,
class T, R (T::*F)()>
71 DWORD __stdcall CALLBACK embedded_mem_fun(
void *p)
73 return ((reinterpret_cast<T*>(p))->*F)();
79 template<
class _Invoker>
80 DWORD __stdcall CALLBACK thread_fun(
void *_p)
82 typename _Invoker::ParamType *p =
reinterpret_cast< typename _Invoker::ParamType *
> (_p);
98 typedef void * ReturnType;
99 typedef void * ParamType;
102 typedef void *(*CallBackType) (
void *);
113 template<
class R, R (*Func)()>
114 void * embedded_ptr_fun(
void *__Unused)
121 template<
class R,
class T, R (T::*F)()>
122 void * embedded_mem_fun(
void *p)
124 return ((reinterpret_cast<T*>(p))->*F)();
127 template<
class _Invoker>
128 void * thread_fun(
void *_p)
130 typename _Invoker::ParamType *p =
reinterpret_cast< typename _Invoker::ParamType *
> (_p);
pthread thread creation params
Definition: function.h:95
void *(* CallBackType)(void *)
The callback type supporter by local thread architecture.
Definition: function.h:102