From 7d73f58e9cea8f4b0bc16512983898fddde3d764 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Wed, 20 Apr 2022 16:47:29 +1000 Subject: Increase threadsafety annotation coverage --- src/validationinterface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/validationinterface.cpp') diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index edc4633c01..3f7fad3f87 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -42,7 +42,7 @@ public: explicit MainSignalsInstance(CScheduler& scheduler LIFETIMEBOUND) : m_schedulerClient(scheduler) {} - void Register(std::shared_ptr callbacks) + void Register(std::shared_ptr 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 void Iterate(F&& f) + template void Iterate(F&& f) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) { WAIT_LOCK(m_mutex, lock); for (auto it = m_list.begin(); it != m_list.end();) { -- cgit v1.2.3