Browse Source

better naming

synchronous
Volker Birk 5 years ago
parent
commit
1aa042c038
  1. 4
      passphrase_cache.cc
  2. 2
      passphrase_cache.hh

4
passphrase_cache.cc

@ -48,7 +48,7 @@ namespace pEp {
const char *PassphraseCache::add_stored(const std::string& passphrase) const char *PassphraseCache::add_stored(const std::string& passphrase)
{ {
std::lock_guard<std::mutex> lock(_shared_mtx); std::lock_guard<std::mutex> lock(_stored_mtx);
_stored = passphrase; _stored = passphrase;
return _stored.c_str(); return _stored.c_str();
} }
@ -59,7 +59,7 @@ namespace pEp {
return true; return true;
{ {
std::lock_guard<std::mutex> lock(_shared_mtx); std::lock_guard<std::mutex> lock(_stored_mtx);
if (!_stored.empty() && callee(_stored)) if (!_stored.empty() && callee(_stored))
return true; return true;
} }

2
passphrase_cache.hh

@ -26,7 +26,7 @@ namespace pEp {
cache _cache; cache _cache;
std::string _stored; std::string _stored;
std::mutex _mtx; std::mutex _mtx;
std::mutex _shared_mtx; std::mutex _stored_mtx;
size_t _max_size; size_t _max_size;
duration _timeout; duration _timeout;

Loading…
Cancel
Save