diff options
author | luigi1111 <luigi1111w@gmail.com> | 2023-11-06 09:21:55 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2023-11-06 09:21:55 -0500 |
commit | 3cea45bc56c6a6d9d7b62be9b9994e69541b7f4f (patch) | |
tree | 24a144c2ca60cfaae0e034152a6e73641435dd4a /src/device_trezor | |
parent | Merge pull request #9026 (diff) | |
parent | cmake: set -fno-aligned-allocation on macOS ARM (diff) | |
download | monero-3cea45bc56c6a6d9d7b62be9b9994e69541b7f4f.tar.xz |
Merge pull request #8922
b4491c1 cmake: set -fno-aligned-allocation on macOS ARM (selsta)
df9f380 cmake: set BOOST_NO_AUTO_PTR to fix c++17 compilation (selsta)
5136974 device: boost -> std locks to fix c++17 compilation (selsta)
5965b02 cmake: set cpp17 standard (selsta)
Diffstat (limited to 'src/device_trezor')
-rw-r--r-- | src/device_trezor/device_trezor_base.hpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/device_trezor/device_trezor_base.hpp b/src/device_trezor/device_trezor_base.hpp index df6e42b1f..e0fc2aafb 100644 --- a/src/device_trezor/device_trezor_base.hpp +++ b/src/device_trezor/device_trezor_base.hpp @@ -32,13 +32,12 @@ #include <cstddef> +#include <mutex> #include <string> #include "device/device.hpp" #include "device/device_default.hpp" #include "device/device_cold.hpp" #include <boost/scope_exit.hpp> -#include <boost/thread/mutex.hpp> -#include <boost/thread/recursive_mutex.hpp> #include "cryptonote_config.h" #include "trezor.hpp" @@ -49,12 +48,12 @@ //automatic lock one more level on device ensuring the current thread is allowed to use it #define TREZOR_AUTO_LOCK_CMD() \ /* lock both mutexes without deadlock*/ \ - boost::lock(device_locker, command_locker); \ + std::lock(device_locker, command_locker); \ /* make sure both already-locked mutexes are unlocked at the end of scope */ \ - boost::lock_guard<boost::recursive_mutex> lock1(device_locker, boost::adopt_lock); \ - boost::lock_guard<boost::mutex> lock2(command_locker, boost::adopt_lock) + std::lock_guard<std::recursive_mutex> lock1(device_locker, std::adopt_lock); \ + std::lock_guard<std::mutex> lock2(command_locker, std::adopt_lock) -#define TREZOR_AUTO_LOCK_DEVICE() boost::lock_guard<boost::recursive_mutex> lock1_device(device_locker) +#define TREZOR_AUTO_LOCK_DEVICE() std::lock_guard<std::recursive_mutex> lock1_device(device_locker) namespace hw { namespace trezor { @@ -86,8 +85,8 @@ namespace trezor { protected: // Locker for concurrent access - mutable boost::recursive_mutex device_locker; - mutable boost::mutex command_locker; + mutable std::recursive_mutex device_locker; + mutable std::mutex command_locker; std::shared_ptr<Transport> m_transport; i_device_callback * m_callback; |