summaryrefslogtreecommitdiffstats
path: root/src/Client/InformationManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Client/InformationManager.h')
-rw-r--r--src/Client/InformationManager.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/Client/InformationManager.h b/src/Client/InformationManager.h
index 239b8d8..a7d2354 100644
--- a/src/Client/InformationManager.h
+++ b/src/Client/InformationManager.h
@@ -38,17 +38,14 @@ class InformationManager : public Common::Initializable, private boost::noncopya
private:
class DaemonStateUpdateRequestHandler : public Common::RequestHandler {
protected:
- virtual void handlePacket(const Common::XmlPacket &packet);
-
- public:
- DaemonStateUpdateRequestHandler(Common::Connection *connection, uint16_t requestId)
- : RequestHandler(connection, requestId) {}
+ virtual void handlePacket(boost::shared_ptr<const Common::XmlPacket> packet);
};
static InformationManager informationManager;
boost::mutex mutex;
- boost::condition_variable updateCond;
+
+ boost::shared_ptr<Common::Request> updateRequest;
std::map<std::string, Common::HostInfo> daemons;
@@ -56,7 +53,7 @@ class InformationManager : public Common::Initializable, private boost::noncopya
InformationManager() : updating(false) {}
- void daemonListRequestFinished(Common::Request &request);
+ void daemonListRequestFinished(boost::shared_ptr<const Common::XmlPacket> packet, Net::Exception error);
protected:
virtual void doInit();
@@ -76,9 +73,11 @@ class InformationManager : public Common::Initializable, private boost::noncopya
void waitWhileUpdating() {
boost::unique_lock<boost::mutex> lock(mutex);
+ boost::shared_ptr<Common::Request> request = updateRequest;
+ lock.unlock();
- while(updating)
- updateCond.wait(lock);
+ if(request)
+ request->wait();
}