Merge pull request #396 from michael-loki/profiling_thread_safety

Fix deadlock in profiling
This commit is contained in:
Jeff 2019-03-14 08:55:23 -04:00 committed by GitHub
commit d6307cfb2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -190,7 +190,6 @@ namespace llarp
if(!profile.BDecode(buf))
return false;
RouterID pk = k.base;
absl::WriterMutexLock l(&m_ProfilesMutex);
return m_Profiles.emplace(pk, profile).second;
}

View File

@ -69,13 +69,14 @@ namespace llarp
MarkPathSuccess(path::Path* p) LOCKS_EXCLUDED(m_ProfilesMutex);
void
Tick();
Tick() LOCKS_EXCLUDED(m_ProfilesMutex);
bool
BEncode(llarp_buffer_t* buf) const override LOCKS_EXCLUDED(m_ProfilesMutex);
bool
DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* buf) override;
DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* buf) override
SHARED_LOCKS_REQUIRED(m_ProfilesMutex);
bool
Load(const char* fname) LOCKS_EXCLUDED(m_ProfilesMutex);