HomePhabricator

Limit scope of all global std::once_flag

Description

Limit scope of all global std::once_flag

Summary:

once_flag is a helper (as the name might suggest) to execute a callable only once. Thus, the scope of the flag does never need to extend beyond where the callable is called. Typically this is function scope.

Move all the flags to function scope to

simplify code review
avoid mistakes where similarly named flags are accidentally exchanged
avoid polluting the global scope

This is a backport of core#19111

Depends on D9260

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on May 29 2020, 21:21
PiRKCommitted on Feb 24 2021, 07:23
PiRKPushed on Feb 24 2021, 07:23
Reviewer
Restricted Project
Differential Revision
D9264: Limit scope of all global std::once_flag
Parents
rABC06eae6f27d14: tests: implement base58_decode
Branches
Unknown
Tags
Unknown