summaryrefslogtreecommitdiff
path: root/src/web_service/web_backend.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-01 14:36:24 -0400
committerGitHub <noreply@github.com>2019-04-01 14:36:24 -0400
commite0eee250bb4d70f4fc4973f08649636faf9808cf (patch)
treeeaf2aabd5471c13fe89ac5f7da247b3bf1248e83 /src/web_service/web_backend.cpp
parentd9b7bc44748908d49d59433870211df8e1c32581 (diff)
parent781ab8407b50d303197ab6fb888ed35ecbcce23a (diff)
Merge pull request #2312 from lioncash/locks
general: Use deducation guides for std::lock_guard and std::unique_lock
Diffstat (limited to 'src/web_service/web_backend.cpp')
-rw-r--r--src/web_service/web_backend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp
index 40da1a4e2..dc149d2ed 100644
--- a/src/web_service/web_backend.cpp
+++ b/src/web_service/web_backend.cpp
@@ -24,7 +24,7 @@ constexpr u32 TIMEOUT_SECONDS = 30;
struct Client::Impl {
Impl(std::string host, std::string username, std::string token)
: host{std::move(host)}, username{std::move(username)}, token{std::move(token)} {
- std::lock_guard<std::mutex> lock(jwt_cache.mutex);
+ std::lock_guard lock{jwt_cache.mutex};
if (this->username == jwt_cache.username && this->token == jwt_cache.token) {
jwt = jwt_cache.jwt;
}
@@ -151,7 +151,7 @@ struct Client::Impl {
if (result.result_code != Common::WebResult::Code::Success) {
LOG_ERROR(WebService, "UpdateJWT failed");
} else {
- std::lock_guard<std::mutex> lock(jwt_cache.mutex);
+ std::lock_guard lock{jwt_cache.mutex};
jwt_cache.username = username;
jwt_cache.token = token;
jwt_cache.jwt = jwt = result.returned_data;