diff --git a/passphrase_cache.cc b/passphrase_cache.cc index c7dad6f..4019a61 100644 --- a/passphrase_cache.cc +++ b/passphrase_cache.cc @@ -48,7 +48,7 @@ namespace pEp { const char *PassphraseCache::add_stored(const std::string& passphrase) { - std::lock_guard lock(_shared_mtx); + std::lock_guard lock(_stored_mtx); _stored = passphrase; return _stored.c_str(); } @@ -59,7 +59,7 @@ namespace pEp { return true; { - std::lock_guard lock(_shared_mtx); + std::lock_guard lock(_stored_mtx); if (!_stored.empty() && callee(_stored)) return true; } diff --git a/passphrase_cache.hh b/passphrase_cache.hh index 3a82655..13121e9 100644 --- a/passphrase_cache.hh +++ b/passphrase_cache.hh @@ -26,7 +26,7 @@ namespace pEp { cache _cache; std::string _stored; std::mutex _mtx; - std::mutex _shared_mtx; + std::mutex _stored_mtx; size_t _max_size; duration _timeout;