epicsThread avoid possible data race on joined
This commit is contained in:
@@ -153,11 +153,13 @@ bool epicsThread::exitWait ( const double delay ) throw ()
|
||||
if ( this->pThreadDestroyed ) {
|
||||
*this->pThreadDestroyed = true;
|
||||
}
|
||||
if(!joined) {
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
joined = true;
|
||||
}
|
||||
bool j;
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
j = joined;
|
||||
joined = true;
|
||||
}
|
||||
if(!j) {
|
||||
epicsThreadMustJoin(this->id);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user