Added Thread:isRunning

This commit is contained in:
Alex Szpakowski
2013-07-16 00:18:04 -03:00
parent 719e9253da
commit 8ac288876d
10 changed files with 42 additions and 11 deletions
+6
View File
@@ -68,6 +68,12 @@ void Thread::wait()
thread = 0;
}
bool Thread::isRunning()
{
Lock l(mutex);
return running;
}
int Thread::thread_runner(void *data)
{
Thread *self = (Thread *) data; // some compilers don't like 'this'
+13 -7
View File
@@ -36,19 +36,25 @@ namespace sdl
{
class Thread : public thread::Thread
{
private:
Threadable *t;
bool running;
SDL_Thread *thread;
static int thread_runner(void *data);
Mutex mutex;
public:
Thread(Threadable *t);
~Thread();
bool start();
void wait();
bool isRunning();
private:
Threadable *t;
bool running;
SDL_Thread *thread;
Mutex mutex;
static int thread_runner(void *data);
}; // Thread
} // sdl
} // thread
} // love