Use boost::thread instead of std::thread

and all other associated IPC
This commit is contained in:
Howard Chu 2016-03-11 12:25:28 +00:00
parent b96147030c
commit b937a2c915
27 changed files with 107 additions and 103 deletions

View file

@ -31,7 +31,8 @@
#pragma once
#include <cstddef>
#include <mutex>
#include <boost/thread/mutex.hpp>
#include <boost/thread/lock_guard.hpp>
#include <vector>
#include "common/pod-class.h"
@ -44,7 +45,7 @@ namespace crypto {
#include "random.h"
}
extern std::mutex random_lock;
extern boost::mutex random_lock;
#pragma pack(push, 1)
POD_CLASS ec_point {
@ -121,7 +122,7 @@ namespace crypto {
template<typename T>
typename std::enable_if<std::is_pod<T>::value, T>::type rand() {
typename std::remove_cv<T>::type res;
std::lock_guard<std::mutex> lock(random_lock);
boost::lock_guard<boost::mutex> lock(random_lock);
generate_random_bytes(sizeof(T), &res);
return res;
}