summaryrefslogtreecommitdiff
path: root/src/monitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/monitor.cpp')
-rw-r--r--src/monitor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/monitor.cpp b/src/monitor.cpp
index 95212fd..1cccfd0 100644
--- a/src/monitor.cpp
+++ b/src/monitor.cpp
@@ -46,6 +46,9 @@ void zmq::monitor_t::stop ()
void zmq::monitor_t::log (int sid_, const char *text_)
{
+ sync.lock ();
+ text = text_;
+ sync.unlock ();
}
void zmq::monitor_t::process_plug ()
@@ -65,7 +68,10 @@ void zmq::monitor_t::timer_event (int id_)
{
zmq_assert (id_ == timer_id);
- // TODO: Send the snapshot here!
+ // Send the snapshot here!
+ sync.lock ();
+ publish_logs (text.c_str ());
+ sync.unlock ();
// Wait before sending next snapshot.
add_timer (500 + (generate_random () % 1000), timer_id);