aboutsummaryrefslogtreecommitdiff
path: root/src/common/dns_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/dns_utils.cpp')
-rw-r--r--src/common/dns_utils.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
index 8b7c9b4d9..ce57151f5 100644
--- a/src/common/dns_utils.cpp
+++ b/src/common/dns_utils.cpp
@@ -38,6 +38,8 @@
using namespace epee;
namespace bf = boost::filesystem;
+static std::mutex instance_lock;
+
namespace
{
@@ -326,6 +328,8 @@ std::string DNSResolver::get_dns_format_from_oa_address(const std::string& oa_ad
DNSResolver& DNSResolver::instance()
{
+ std::lock_guard<std::mutex> lock(instance_lock);
+
static DNSResolver* staticInstance = NULL;
if (staticInstance == NULL)
{