From 0f0c75ae659400e1df639d9644f58930291e7309 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 24 Apr 2017 13:18:40 +0200 Subject: Rename device mutex in NitrokeyManager Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 5939cbf..d2403c1 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -12,7 +12,7 @@ namespace nitrokey{ - std::mutex mex_dev_com; + std::mutex mex_dev_com_manager; #ifdef __WIN32 #pragma message "Using own strndup" @@ -87,7 +87,7 @@ char * strndup(const char* str, size_t maxlen){ return false; } - std::lock_guard lock(mex_dev_com); + std::lock_guard lock(mex_dev_com_manager); if(device == nullptr) { return false; } @@ -97,7 +97,7 @@ char * strndup(const char* str, size_t maxlen){ } bool NitrokeyManager::connect() { - std::lock_guard lock(mex_dev_com); + std::lock_guard lock(mex_dev_com_manager); vector< shared_ptr > devices = { make_shared(), make_shared() }; for( auto & d : devices ){ if (d->connect()){ @@ -123,7 +123,7 @@ char * strndup(const char* str, size_t maxlen){ } bool NitrokeyManager::connect(const char *device_model) { - std::lock_guard lock(mex_dev_com); + std::lock_guard lock(mex_dev_com_manager); LOG(__FUNCTION__, nitrokey::log::Loglevel::DEBUG_L2); switch (device_model[0]){ case 'P': @@ -150,7 +150,7 @@ char * strndup(const char* str, size_t maxlen){ bool NitrokeyManager::disconnect() { - std::lock_guard lock(mex_dev_com); + std::lock_guard lock(mex_dev_com_manager); return _disconnect_no_lock(); } @@ -166,7 +166,7 @@ char * strndup(const char* str, size_t maxlen){ } bool NitrokeyManager::is_connected() throw(){ - std::lock_guard lock(mex_dev_com); + std::lock_guard lock(mex_dev_com_manager); if(device != nullptr){ auto connected = device->could_be_enumerated(); if(connected){ @@ -180,7 +180,7 @@ char * strndup(const char* str, size_t maxlen){ } bool NitrokeyManager::could_current_device_be_enumerated() { - std::lock_guard lock(mex_dev_com); + std::lock_guard lock(mex_dev_com_manager); if (device != nullptr) { return device->could_be_enumerated(); } -- cgit v1.2.3