add lock for MonitorUser

This commit is contained in:
Michael Davidsaver
2015-12-08 17:03:03 -05:00
parent 3865745790
commit 7de48f0bda
3 changed files with 38 additions and 17 deletions
+4 -1
View File
@@ -369,16 +369,19 @@ void statusServer(int lvl, const char *chanexpr)
MonitorUser& MU = **it3;
size_t nempty, nfilled, nused, total;
bool isrunning;
{
Guard G(scp->cache.cacheLock);
nempty = MU.empty.size();
nfilled = MU.filled.size();
nused = MU.inuse.size();
isrunning = MU.running;
}
total = nempty + nfilled + nused;
std::cout<<" Server monitor buffer "<<nfilled<<"/"<<total
std::cout<<" Server monitor"<<(isrunning?"":" Paused")
<<" buffer "<<nfilled<<"/"<<total
<<" out "<<nused<<"/"<<total
<<" "<<epicsAtomicGetSizeT(&MU.nwakeups)<<" wakeups "
<<epicsAtomicGetSizeT(&MU.nevents)<<" events "