caProvider threads: Lock the mutex while reading isStop state
This commit is contained in:

committed by
mdavidsaver

parent
f9cbaf72ff
commit
9671ee132e
@ -105,7 +105,7 @@ void ChannelConnectThread::run()
|
||||
if(channel) channel->notifyClient();
|
||||
}
|
||||
}
|
||||
if(isStop) {
|
||||
if(stopping()) {
|
||||
waitForStop.signal();
|
||||
break;
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ public:
|
||||
void channelConnected(NotifyChannelRequesterPtr const ¬ifyChannelRequester);
|
||||
private:
|
||||
ChannelConnectThread();
|
||||
bool stopping() {
|
||||
pvData::Lock the(mutex);
|
||||
return isStop;
|
||||
}
|
||||
|
||||
bool isStop;
|
||||
std::tr1::shared_ptr<epicsThread> thread;
|
||||
|
@ -104,7 +104,7 @@ void GetDoneThread::run()
|
||||
if(channelGet) channelGet->notifyClient();
|
||||
}
|
||||
}
|
||||
if(isStop) {
|
||||
if(stopping()) {
|
||||
waitForStop.signal();
|
||||
break;
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ public:
|
||||
void getDone(NotifyGetRequesterPtr const ¬ifyGetRequester);
|
||||
private:
|
||||
GetDoneThread();
|
||||
bool stopping() {
|
||||
pvData::Lock the(mutex);
|
||||
return isStop;
|
||||
}
|
||||
|
||||
bool isStop;
|
||||
std::tr1::shared_ptr<epicsThread> thread;
|
||||
|
@ -103,7 +103,7 @@ void MonitorEventThread::run()
|
||||
if(channelMonitor) channelMonitor->notifyClient();
|
||||
}
|
||||
}
|
||||
if(isStop) {
|
||||
if(stopping()) {
|
||||
waitForStop.signal();
|
||||
break;
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ public:
|
||||
void event(NotifyMonitorRequesterPtr const ¬ifyMonitorRequester);
|
||||
private:
|
||||
MonitorEventThread();
|
||||
bool stopping() {
|
||||
pvData::Lock the(mutex);
|
||||
return isStop;
|
||||
}
|
||||
|
||||
bool isStop;
|
||||
std::tr1::shared_ptr<epicsThread> thread;
|
||||
|
@ -104,7 +104,7 @@ void PutDoneThread::run()
|
||||
if(channelPut) channelPut->notifyClient();
|
||||
}
|
||||
}
|
||||
if(isStop) {
|
||||
if(stopping()) {
|
||||
waitForStop.signal();
|
||||
break;
|
||||
}
|
||||
|
@ -56,6 +56,11 @@ public:
|
||||
void putDone(NotifyPutRequesterPtr const ¬ifyPutRequester);
|
||||
private:
|
||||
PutDoneThread();
|
||||
bool stopping() {
|
||||
pvData::Lock the(mutex);
|
||||
return isStop;
|
||||
}
|
||||
|
||||
bool isStop;
|
||||
std::tr1::shared_ptr<epicsThread> thread;
|
||||
epics::pvData::Mutex mutex;
|
||||
|
Reference in New Issue
Block a user