mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-04 19:08:51 +02:00
bugfix: Mark m_tip_block_cv as guarded by m_tip_block_mutex
This is not strictly required, but all places using m_tip_block_cv (except shutdown) already take the lock. The annotation makes it easier to catch potential deadlocks before review. Adding the missing lock to the shutdown sequence is a bugfix. An alternative would be to take the lock and release it before notifying, see https://github.com/bitcoin/bitcoin/pull/30967#discussion_r1778899716
This commit is contained in:
@@ -58,7 +58,7 @@ public:
|
||||
bool m_shutdown_on_fatal_error{true};
|
||||
|
||||
Mutex m_tip_block_mutex;
|
||||
std::condition_variable m_tip_block_cv;
|
||||
std::condition_variable m_tip_block_cv GUARDED_BY(m_tip_block_mutex);
|
||||
//! The block for which the last blockTip notification was received for.
|
||||
uint256 m_tip_block GUARDED_BY(m_tip_block_mutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user