3 #include <boost/thread.hpp>
11 typedef std::map<LHEProxy::ProxyID, std::weak_ptr<LHEProxy> >
ProxyMap;
14 static struct Sentinel {
24 return sentinel.instance;
30 boost::mutex::scoped_lock scoped_lock(
mutex);
40 boost::mutex::scoped_lock scoped_lock(
mutex);
42 std::shared_ptr<LHEProxy> proxy(
new LHEProxy(++nextProxyID));
52 boost::mutex::scoped_lock scoped_lock(
mutex);
56 return std::shared_ptr<LHEProxy>();
58 ProxyMap::const_iterator
pos =
map->find(
id);
60 return std::shared_ptr<LHEProxy>();
62 return std::shared_ptr<LHEProxy>(
pos->second);