caProvider threads: Lock the mutex while reading isStop state

This commit is contained in:
Andrew Johnson
2020-06-29 13:32:13 -05:00
committed by mdavidsaver
parent f9cbaf72ff
commit 9671ee132e
8 changed files with 21 additions and 4 deletions

View File

@ -105,7 +105,7 @@ void ChannelConnectThread::run()
if(channel) channel->notifyClient();
}
}
if(isStop) {
if(stopping()) {
waitForStop.signal();
break;
}

View File

@ -56,6 +56,10 @@ public:
void channelConnected(NotifyChannelRequesterPtr const &notifyChannelRequester);
private:
ChannelConnectThread();
bool stopping() {
pvData::Lock the(mutex);
return isStop;
}
bool isStop;
std::tr1::shared_ptr<epicsThread> thread;

View File

@ -104,7 +104,7 @@ void GetDoneThread::run()
if(channelGet) channelGet->notifyClient();
}
}
if(isStop) {
if(stopping()) {
waitForStop.signal();
break;
}

View File

@ -56,6 +56,10 @@ public:
void getDone(NotifyGetRequesterPtr const &notifyGetRequester);
private:
GetDoneThread();
bool stopping() {
pvData::Lock the(mutex);
return isStop;
}
bool isStop;
std::tr1::shared_ptr<epicsThread> thread;

View File

@ -103,7 +103,7 @@ void MonitorEventThread::run()
if(channelMonitor) channelMonitor->notifyClient();
}
}
if(isStop) {
if(stopping()) {
waitForStop.signal();
break;
}

View File

@ -56,6 +56,10 @@ public:
void event(NotifyMonitorRequesterPtr const &notifyMonitorRequester);
private:
MonitorEventThread();
bool stopping() {
pvData::Lock the(mutex);
return isStop;
}
bool isStop;
std::tr1::shared_ptr<epicsThread> thread;

View File

@ -104,7 +104,7 @@ void PutDoneThread::run()
if(channelPut) channelPut->notifyClient();
}
}
if(isStop) {
if(stopping()) {
waitForStop.signal();
break;
}

View File

@ -56,6 +56,11 @@ public:
void putDone(NotifyPutRequesterPtr const &notifyPutRequester);
private:
PutDoneThread();
bool stopping() {
pvData::Lock the(mutex);
return isStop;
}
bool isStop;
std::tr1::shared_ptr<epicsThread> thread;
epics::pvData::Mutex mutex;