aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2016-01-26 22:09:08 +0000
committerHoward Chu <hyc@symas.com>2016-02-18 21:31:21 +0000
commit014f8868f215175fc8db41f79d57588db9ea1d4d (patch)
tree06c8c0e9c1dfe3fa4143bb402d0e41d6ced86fa1
parentUse boost::thread instead of std::thread (diff)
downloadmonero-014f8868f215175fc8db41f79d57588db9ea1d4d.tar.xz
std::condvar is broken on Win32 with gcc/g++ 4.8 too
Use boost...
-rw-r--r--contrib/epee/include/syncobj.h10
-rw-r--r--src/common/dns_utils.cpp4
2 files changed, 6 insertions, 8 deletions
diff --git a/contrib/epee/include/syncobj.h b/contrib/epee/include/syncobj.h
index b81eb43a9..275324436 100644
--- a/contrib/epee/include/syncobj.h
+++ b/contrib/epee/include/syncobj.h
@@ -30,8 +30,6 @@
#ifndef __WINH_OBJ_H__
#define __WINH_OBJ_H__
-#include <condition_variable>
-#include <mutex>
#include <boost/thread/locks.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
@@ -51,22 +49,22 @@ namespace epee
void raise()
{
- std::unique_lock<std::mutex> lock(m_mx);
+ boost::unique_lock<boost::mutex> lock(m_mx);
m_rised = true;
m_cond_var.notify_one();
}
void wait()
{
- std::unique_lock<std::mutex> lock(m_mx);
+ boost::unique_lock<boost::mutex> lock(m_mx);
while (!m_rised)
m_cond_var.wait(lock);
m_rised = false;
}
private:
- std::mutex m_mx;
- std::condition_variable m_cond_var;
+ boost::mutex m_mx;
+ boost::condition_variable m_cond_var;
bool m_rised;
};
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
index eb7b6608b..eb0a7de1f 100644
--- a/src/common/dns_utils.cpp
+++ b/src/common/dns_utils.cpp
@@ -38,7 +38,7 @@
using namespace epee;
namespace bf = boost::filesystem;
-static std::mutex instance_lock;
+static boost::mutex instance_lock;
namespace
{
@@ -304,7 +304,7 @@ 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);
+ boost::lock_guard<boost::mutex> lock(instance_lock);
static DNSResolver* staticInstance = NULL;
if (staticInstance == NULL)