- bugfix for segfault in menu when exiting too fast

This commit is contained in:
Mark Vejvoda
2012-03-05 22:53:03 +00:00
parent 7399d10247
commit 623623d33f
5 changed files with 61 additions and 17 deletions

View File

@@ -62,7 +62,7 @@ public:
// =====================================================
// class SimpleTaskThread
// =====================================================
typedef void taskFunctionCallback(BaseThread *callingThread);
//
// This interface describes the methods a callback object must implement
//
@@ -70,8 +70,8 @@ class SimpleTaskCallbackInterface {
public:
virtual void simpleTask(BaseThread *callingThread) = 0;
virtual void setupTask(BaseThread *callingThread) {}
virtual void shutdownTask(BaseThread *callingThread) {}
virtual void setupTask(BaseThread *callingThread) { }
virtual void shutdownTask(BaseThread *callingThread) { }
};
class SimpleTaskThread : public BaseThread
@@ -89,6 +89,8 @@ protected:
Mutex mutexLastExecuteTimestamp;
time_t lastExecuteTimestamp;
taskFunctionCallback *overrideShutdownTask;
public:
SimpleTaskThread(SimpleTaskCallbackInterface *simpleTaskInterface,
unsigned int executionCount=0,
@@ -103,6 +105,10 @@ public:
bool getTaskSignalled();
bool isThreadExecutionLagging();
void cleanup();
void setOverrideShutdownTask(taskFunctionCallback *ptr);
};
// =====================================================