one more race condition when server server exits

This commit is contained in:
Marty Kraimer
2014-12-12 08:18:56 -05:00
parent a781195458
commit c2ea402be0

View File

@ -146,10 +146,12 @@ Status MonitorLocal::stop()
if(pvRecord->getTraceLevel()>0){
cout << "MonitorLocal::stop() " << endl;
}
Lock xx(mutex);
if(state==destroyed) return wasDestroyedStatus;
if(state==idle) return notStartedStatus;
state = idle;
{
Lock xx(mutex);
if(state==destroyed) return wasDestroyedStatus;
if(state==idle) return notStartedStatus;
state = idle;
}
pvCopyMonitor->stopMonitoring();
return Status::Ok;
}