fixed thread bug caused by deleting a thread before it is actually terminated

This commit is contained in:
csoler 2019-05-11 23:43:54 +02:00
parent 6a18e242bb
commit 7b2541e35c
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
3 changed files with 10 additions and 2 deletions

View file

@ -66,8 +66,8 @@ void RsThread::go()
runloop();
mHasStoppedSemaphore.set(1);
mShouldStopSemaphore.set(0);
mHasStoppedSemaphore.set(1); // last value that we modify because this is interpreted as a signal that the object can be deleted.
}
void *RsThread::rsthread_init(void* p)
{

View file

@ -247,7 +247,7 @@ public:
void start(const std::string &threadName = "");
// Returns true of the thread is still running.
// Returns true if the thread is still running.
bool isRunning();