Commit 66f20005 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #5532 from grundman:patch-2

parents 91e9e648 f260b13a
...@@ -304,14 +304,18 @@ void ForThread::stop() ...@@ -304,14 +304,18 @@ void ForThread::stop()
{ {
if(m_state == eFTStarted) if(m_state == eFTStarted)
{ {
pthread_mutex_lock(&m_thread_mutex);
m_state = eFTToStop; m_state = eFTToStop;
pthread_mutex_unlock(&m_thread_mutex);
run(); run();
pthread_join(m_posix_thread, NULL); pthread_join(m_posix_thread, NULL);
} }
pthread_mutex_lock(&m_thread_mutex);
m_state = eFTStoped; m_state = eFTStoped;
pthread_mutex_unlock(&m_thread_mutex);
} }
void ForThread::run() void ForThread::run()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment