Update: Thread Termination procedure

to release all pthread allocate memories.

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2016-10-26 11:33:25 +09:00
parent c3e8470812
commit 5026c94502
5 changed files with 17 additions and 4 deletions

View File

@@ -514,3 +514,11 @@ void Thread::stopProcess(void)
theMultiTaskProcess->threadStoped();
}
void Thread::stop(void)
{
if ( _threadID )
{
pthread_join(_threadID, NULL);
_threadID = 0;
}
}

View File

@@ -128,6 +128,7 @@ public:
virtual void initialize(int argc, char** argv);
void stopProcess(void);
void waitStop(void);
void stop(void);
private:
static void* _run(void*);
pthread_t _threadID;