diff options
author | randomdan <randomdan@localhost> | 2014-05-01 00:16:47 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2014-05-01 00:16:47 +0000 |
commit | c078774faf086e7e9985d276bab0b63d082b40da (patch) | |
tree | 16744398d2a7005b06261cbf65bc73454e785b34 /netfs/daemon | |
parent | Whoops, add file offset bits definition to fix 64bit compat bug (diff) | |
download | netfs-c078774faf086e7e9985d276bab0b63d082b40da.tar.bz2 netfs-c078774faf086e7e9985d276bab0b63d082b40da.tar.xz netfs-c078774faf086e7e9985d276bab0b63d082b40da.zip |
Use IceUtil::Shared/Handle, which is already thread safe, instead of boost::intrusive_ptr and IntrusivePtrBase, which isn't, to undo the mess introduced in 937 to enforce thread safety
Diffstat (limited to 'netfs/daemon')
-rw-r--r-- | netfs/daemon/daemonConfig.cpp | 6 | ||||
-rw-r--r-- | netfs/daemon/daemonConfig.h | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/netfs/daemon/daemonConfig.cpp b/netfs/daemon/daemonConfig.cpp index 7f171eb..7f75900 100644 --- a/netfs/daemon/daemonConfig.cpp +++ b/netfs/daemon/daemonConfig.cpp @@ -10,6 +10,12 @@ myHostname() return buf; } +bool +DaemonConfig::Host::operator<(const DaemonConfig::Host & other) const +{ + return (this->name < other.name); +} + DaemonConfigPtr DaemonConfig::Load(const std::string & path) { diff --git a/netfs/daemon/daemonConfig.h b/netfs/daemon/daemonConfig.h index f27aedb..c4513cb 100644 --- a/netfs/daemon/daemonConfig.h +++ b/netfs/daemon/daemonConfig.h @@ -4,26 +4,26 @@ #include <string> #include <map> #include <set> -#include <intrusivePtrBase.h> -#include <boost/intrusive_ptr.hpp> +#include <IceUtil/Shared.h> #include <boost/filesystem/path.hpp> #include "xml.h" -class DaemonConfig : public virtual IntrusivePtrBase { +class DaemonConfig : public IceUtil::Shared { public: - class Host : public virtual IntrusivePtrBase { + class Host : public IceUtil::Shared { public: Host(xmlNodePtr); std::string iceEndpoint; std::string name; bool self; + bool operator<(const Host &) const; }; - typedef boost::intrusive_ptr<Host> HostPtr; + typedef IceUtil::Handle<Host> HostPtr; typedef std::map<std::string, HostPtr> HostMap; typedef std::set<HostPtr> HostSet; - class Export : public virtual IntrusivePtrBase { + class Export : public IceUtil::Shared { public: Export(xmlNodePtr, const HostMap &); @@ -31,18 +31,18 @@ class DaemonConfig : public virtual IntrusivePtrBase { std::string name; HostSet replicate; }; - typedef boost::intrusive_ptr<Export> ExportPtr; + typedef IceUtil::Handle<Export> ExportPtr; typedef std::map<std::string, ExportPtr> ExportMap; DaemonConfig(xmlNodePtr); - static boost::intrusive_ptr<DaemonConfig> Load(const std::string & path); + static IceUtil::Handle<DaemonConfig> Load(const std::string & path); ExportMap exports; HostMap hosts; HostPtr self; }; -typedef boost::intrusive_ptr<DaemonConfig> DaemonConfigPtr; +typedef IceUtil::Handle<DaemonConfig> DaemonConfigPtr; #endif |