Page MenuHomePhabricator

Prevent mutex lock fail even if --enable-debug
ClosedPublic

Authored by deadalnix on Jun 30 2019, 21:46.

Details

Summary

This PR intends to resolve #15227.

"configure --debug-enabled" enables "#ifdef DEBUG_LOCKORDER".
Then "lockdata" (in sync.cpp) will be initialized same as other
static objects.

But unfortunately, lockdata.push_lock() was called before its
initialization (via initializing signatureCache which is declared
in script/sigcache.cpp) on macOS.

This PR apply the "Construct On First Use Idiom" to "lockdata"
to prevent it.

This is a backport of Core PR15233

Depends on D3476

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
syncpreventlockfail
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6568
Build 11183: Bitcoin ABC Buildbot (legacy)
Build 11182: arc lint + arc unit