00001 00002 #include "Core/precomp.h" 00003 00004 #ifndef header_runnable_func 00005 #define header_runnable_func 00006 00007 #include "API/Core/System/thread.h" 00008 00009 class CL_Runnable_Func : public CL_Runnable 00010 { 00011 public: 00012 CL_Runnable_Func(int (*func)(void*), void* value) 00013 { 00014 this->func = func; 00015 this->value = value; 00016 } 00017 00018 virtual void run() 00019 { 00020 func(value); 00021 } 00022 00023 private: 00024 int (*func)(void*); 00025 void* value; 00026 }; 00027 00028 CL_Thread *CL_Thread::create(int (*func)(void*), void* value) 00029 { 00030 return CL_Thread::create( 00031 new CL_Runnable_Func(func, value)); 00032 } 00033 00034 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001