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