HomePhabricator

Remove cs_main lock annotation from ChainstateManager.m_blockman

Description

Remove cs_main lock annotation from ChainstateManager.m_blockman

Summary:
BlockManager is a large data structure, and cs_main is not required to
take its address or access every part of it. Individual BlockManager
fields and methods which do require cs_main like m_block_index and
LookupBlockIndex are already annotated separately, and these other
annotations describe locking requirements more accurately and do a
better job enforcing thread safety.

Since cs_main is not needed to access the address of the m_block object,
this commit drops cs_main LOCK calls which were added pointlessly to
satisfy this annotation in the past.

Co-authored-by: Carl Dong <contact@carldong.me>

This is a backport of core#24024

Test Plan:
With clang and Debug
ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12909

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Jan 10 2022, 20:26
PiRKCommitted on Dec 19 2022, 11:12
PiRKPushed on Dec 19 2022, 11:13
Reviewer
Restricted Project
Differential Revision
D12909: Remove cs_main lock annotation from ChainstateManager.m_blockman
Parents
rABC854f52fd5731: Improve mempool trimming performance
Branches
Unknown
Tags
Unknown