Merge pull request #5153

32ebc95d CMakeLists.txt: detect and use -pthread compiler flag (moneromooo-monero)
be2d061b miner: fix build with boost 1.69 (moneromooo-monero)
1de62cb1 mlocker: fix access to global lock map after dtor on exit (moneromooo-monero)
5544bb83 mlocker: fix dtor ordering problem (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2019-02-18 11:14:50 +02:00
commit 1a0fa56189
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
3 changed files with 7 additions and 5 deletions

View file

@ -428,6 +428,8 @@ if (UNIX AND NOT APPLE)
# Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
add_c_flag_if_supported(-pthread CMAKE_C_FLAGS)
add_cxx_flag_if_supported(-pthread CMAKE_CXX_FLAGS)
endif()
# Handle OpenSSL, used for sha256sum on binary updates and light wallet ssl http

View file

@ -83,13 +83,13 @@ namespace epee
boost::mutex &mlocker::mutex()
{
static boost::mutex vmutex;
return vmutex;
static boost::mutex *vmutex = new boost::mutex();
return *vmutex;
}
std::map<size_t, unsigned int> &mlocker::map()
{
static std::map<size_t, unsigned int> vmap;
return vmap;
static std::map<size_t, unsigned int> *vmap = new std::map<size_t, unsigned int>();
return *vmap;
}
size_t mlocker::get_page_size()

View file

@ -637,7 +637,7 @@ namespace cryptonote
boost::tribool battery_powered(on_battery_power());
if(!indeterminate( battery_powered ))
{
on_ac_power = !battery_powered;
on_ac_power = !(bool)battery_powered;
}
}