- added safety check to thread execution
This commit is contained in:
parent
773bc8659f
commit
a4e75417e4
|
@ -11,9 +11,12 @@
|
|||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <assert.h>
|
||||
|
||||
#include "noimpl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Shared{ namespace Platform{
|
||||
|
||||
// =====================================
|
||||
|
@ -39,6 +42,10 @@ void Thread::setPriority(Thread::Priority threadPriority) {
|
|||
|
||||
int Thread::beginExecution(void* data) {
|
||||
Thread* thread = static_cast<Thread*> (data);
|
||||
assert(thread != NULL);
|
||||
if(thread == NULL) {
|
||||
throw runtime_error("thread == NULL");
|
||||
}
|
||||
thread->execute();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue