testServer: Monitor::start()/stop() implemented

This commit is contained in:
Matej Sekoranja
2013-09-19 09:54:49 +02:00
parent 0a3cc3d95e
commit 9e607e7697
+11 -3
View File
@@ -1399,6 +1399,8 @@ private:
bool m_first;
Mutex m_lock;
int m_count;
AtomicBoolean m_active;
MonitorElement::shared_pointer m_thisPtr;
MonitorElement::shared_pointer m_nullMonitor;
@@ -1444,6 +1446,8 @@ public:
virtual Status start()
{
m_active.set();
// first monitor
Monitor::shared_pointer thisPtr = shared_from_this();
m_monitorRequester->monitorEvent(thisPtr);
@@ -1453,14 +1457,18 @@ public:
virtual Status stop()
{
m_active.clear();
return Status::Ok;
}
virtual void structureChanged()
{
m_count = 0;
Monitor::shared_pointer thisPtr = shared_from_this();
m_monitorRequester->monitorEvent(thisPtr);
if (m_active.get())
{
m_count = 0;
Monitor::shared_pointer thisPtr = shared_from_this();
m_monitorRequester->monitorEvent(thisPtr);
}
}
virtual MonitorElement::shared_pointer poll()