mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Increase threadsafety annotation coverage
This commit is contained in:
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
explicit MainSignalsInstance(CScheduler& scheduler LIFETIMEBOUND) : m_schedulerClient(scheduler) {}
|
||||
|
||||
void Register(std::shared_ptr<CValidationInterface> callbacks)
|
||||
void Register(std::shared_ptr<CValidationInterface> callbacks) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
auto inserted = m_map.emplace(callbacks.get(), m_list.end());
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
inserted.first->second->callbacks = std::move(callbacks);
|
||||
}
|
||||
|
||||
void Unregister(CValidationInterface* callbacks)
|
||||
void Unregister(CValidationInterface* callbacks) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
auto it = m_map.find(callbacks);
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
//! map entry. After this call, the list may still contain callbacks that
|
||||
//! are currently executing, but it will be cleared when they are done
|
||||
//! executing.
|
||||
void Clear()
|
||||
void Clear() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
for (const auto& entry : m_map) {
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
m_map.clear();
|
||||
}
|
||||
|
||||
template<typename F> void Iterate(F&& f)
|
||||
template<typename F> void Iterate(F&& f) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
|
||||
{
|
||||
WAIT_LOCK(m_mutex, lock);
|
||||
for (auto it = m_list.begin(); it != m_list.end();) {
|
||||
|
||||
Reference in New Issue
Block a user