void DNSResolver::put_state(res_state s)
{
- std::lock_guard<Mutex> l(lock);
+ std::lock_guard l(lock);
states.push_back(s);
}
#endif
#else
{
# ifndef HAVE_THREAD_SAFE_RES_QUERY
- std::lock_guard<Mutex> l(lock);
+ std::lock_guard l(lock);
# endif
len = resolv_h->res_query(origname, ns_c_in, ns_t_cname, buf, sizeof(buf));
}
#else
{
# ifndef HAVE_THREAD_SAFE_RES_QUERY
- std::lock_guard<Mutex> l(lock);
+ std::lock_guard l(lock);
# endif
len = resolv_h->res_query(hostname.c_str(), ns_c_in, type, nsbuf, sizeof(nsbuf));
}
#else
{
# ifndef HAVE_THREAD_SAFE_RES_QUERY
- std::lock_guard<Mutex> l(lock);
+ std::lock_guard l(lock);
# endif
len = resolv_h->res_search(query_str.c_str(), ns_c_in, ns_t_srv, nsbuf,
sizeof(nsbuf));
#include <netinet/in.h>
#include <resolv.h>
-#include "common/Mutex.h"
+#include "common/ceph_mutex.h"
#include "msg/msg_types.h" // for entity_addr_t
namespace ceph {
std::map<std::string, Record> *srv_hosts);
private:
- DNSResolver() : lock("DNSResolver") { resolv_h = new ResolvHWrapper(); }
+ DNSResolver() { resolv_h = new ResolvHWrapper(); }
~DNSResolver();
- Mutex lock;
+ ceph::mutex lock = ceph::make_mutex("DNSResolver::lock");
ResolvHWrapper *resolv_h;
#ifdef HAVE_RES_NQUERY
std::list<res_state> states;