HomePhabricator

Merge #13080: mempool: Add compile time checking for ::mempool.cs runtime…

Description

Merge #13080: mempool: Add compile time checking for ::mempool.cs runtime locking assertions

Summary:
cbba1d2da4 Add compile time checking for all ::mempool.cs runtime locking assertions (practicalswift)

Pull request description:

Add compile time checking for `::mempool.cs` runtime locking assertions.

This PR is a subset of #12665. The PR was broken up to make reviewing easier.

The intention is that literally all `EXCLUSIVE_LOCKS_REQUIRED`/`LOCKS_EXCLUDED`:s added in this PR should follow either directly or indirectly from `AssertLockHeld(…)`/`AssertLockNotHeld(…)`:s already existing in the repo.

Consider the case where function `A(…)` contains `AssertLockHeld(cs_foo)` (without
first locking `cs_foo` in `A`), and that `B(…)` calls `A(…)` (without first locking `cs_main`):
* It _directly_ follows that: `A(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation.
* It _indirectly_ follows that: `B(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation.

Tree-SHA512: 1b5ec1cfca6be67edd1298fea1a52b5572ce833dd4ad05c4583f753c2d3229402663373675df87e950151d5c41aeb3ee02f0ad935ed83fe2f45ca8e4d55d901e

Backport Core PR 13080
https://github.com/bitcoin/bitcoin/pull/13080/files
Depends on D2952

Test Plan:
make check
test_runner.py

Reviewers: deadalnix, Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on May 5 2018, 14:32
jasonbcoxCommitted on May 8 2019, 22:25
jasonbcoxPushed on May 8 2019, 22:25
Reviewer
Restricted Project
Differential Revision
D2955: Merge #13080: mempool: Add compile time checking for ::mempool.cs runtime locking assertions
Parents
rABC62cdb28b5acf: Make functions in rpc/blockchain.cpp static.
Branches
Unknown
Tags
Unknown