diff options
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | contrib/epee/src/mlocker.cpp | 8 | ||||
-rw-r--r-- | src/cryptonote_basic/miner.cpp | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 78d16b2ad..0a995539c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/contrib/epee/src/mlocker.cpp b/contrib/epee/src/mlocker.cpp index 2d6e64e7a..368167174 100644 --- a/contrib/epee/src/mlocker.cpp +++ b/contrib/epee/src/mlocker.cpp @@ -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() diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index 2bd43de94..fb373c6aa 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -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; } } |