From 0ac177534620caa13864f9bfcd804004e3e538fd Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 20 Mar 2015 08:48:48 +0100 Subject: Add ptree upload to mgmt server (incomplete) --- src/ManagementServer.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/ManagementServer.h') diff --git a/src/ManagementServer.h b/src/ManagementServer.h index fa3f170..273f576 100644 --- a/src/ManagementServer.h +++ b/src/ManagementServer.h @@ -351,18 +351,16 @@ class ManagementServer /* Ask if there is a configuration request pending */ bool request_pending() { return m_pending; } + /* Load a ptree given by the management server. + * + * Returns true if the ptree was updated + */ + bool retrieve_new_ptree(boost::property_tree::ptree& pt); + /* Update the copy of the configuration property tree and notify the * update to the internal server thread. */ - void update_ptree(const boost::property_tree::ptree& pt) { - if (m_running) { - boost::unique_lock lock(m_configmutex); - m_pt = pt; - m_pending = false; - - m_condition.notify_one(); - } - } + void update_ptree(const boost::property_tree::ptree& pt); bool fault_detected() { return m_fault; } void restart(void); @@ -415,6 +413,7 @@ class ManagementServer /******** Configuration Data *******/ bool m_pending; + bool m_retrieve_pending; boost::condition_variable m_condition; mutable boost::mutex m_configmutex; -- cgit v1.2.3