8 #warning POSIX will be used (but you did not define it) 33 void operator=(
const Thread &){}
53 static DWORD WINAPI Starter(LPVOID in_thread){
55 static void* Starter(
void* in_thread){
58 thread->_isRunning =
true;
60 thread->_isRunning =
false;
89 CloseHandle (_handle);
99 if(_isRunning)
return false;
101 _handle = CreateThread( 0x00, 0x00,Thread::Starter, static_cast< void* >(
this), 0x00, 0x00);
102 return _handle != NULL;
104 return pthread_create(&_thread, NULL, Thread::Starter, static_cast< void* >(
this)) == 0;
121 if(!_isRunning)
return false;
123 return WaitForSingleObject(_handle,INFINITE) == 0x00000000L;
125 return pthread_join(_thread, NULL) == 0;
134 virtual void run() = 0;
140 if(!_isRunning)
return false;
144 bool success = TerminateThread(_handle,1) && CloseHandle(_handle);
148 return pthread_kill( _thread, SIGKILL) == 0;
virtual void run()=0
the function is called when thread is starting You must implement this methode!
bool wait() const
Wait the end of a thread.
Definition: Thread.hpp:120
different physics engine has different winding order.
Definition: EventBinding.h:32
bool isRunning() const
Fast look up to know if a thread is running.
Definition: Thread.hpp:112
bool start()
start the thread
Definition: Thread.hpp:98
virtual ~Thread()
Destructor, Warning, it waits the end of the current thread.
Definition: Thread.hpp:79
Thread()
Constructor.
Definition: Thread.hpp:69
cross platform thread.
Definition: Thread.hpp:27