Fix issue identified in #7917 around failure to acquire cs_main for chainActive access.
Acquire lock to check for genesis block. #8063
pull pstratem wants to merge 1 commits into bitcoin:master from pstratem:2015-05-16-lockfix changing 1 files +11 −3-
pstratem commented at 3:38 AM on May 17, 2016: contributor
-
Acquire lock to check for genesis block. 46b0c3b688
-
sipa commented at 3:50 AM on May 17, 2016: member
utACK
I think it can be written slightly shorter with a reverse lock around the sleep.
-
gmaxwell commented at 5:31 AM on May 17, 2016: contributor
utACK 46b0c3b688dccf6ba9ac08cbd6d6981249a73b1a
This loses a log entry, but the log entry appears useless...
-
dcousens commented at 5:42 AM on May 17, 2016: contributor
utACK 46b0c3b, it'd be nice to use
std::condition_variableandwaitsignals/semaphores for things like this instead of loops andMilliSleep(10);. -
kazcw commented at 5:47 AM on May 17, 2016: contributor
The loop is emulating a condvar here (specifically
cvBestBlock), but I don't see a good way to deal withfDisconnectin a cond-wait that isn't quite a bit more involved than fixing this little data race. If init ran in a boost thread it'd be interruptible, but nothing inAppInit2expects to be exitable via interruption exceptions... utACK 46b0c3b; I'll open a separate bug relating tofDisconnect - jonasschnelli added the label Refactoring on May 17, 2016
-
TheBlueMatt commented at 2:16 AM on May 18, 2016: member
utACK 46b0c3b688dccf6ba9ac08cbd6d6981249a73b1a
On May 16, 2016 8:38:08 PM PDT, Patrick Strateman notifications@github.com wrote:
Fix issue identified in #7917 around failure to acquire cs_main for chainActive access. You can view, comment on, or merge this pull request online at:
-- Commit Summary --
- Acquire lock to check for genesis block.
-- File Changes --
M src/init.cpp (14)
-- Patch Links --
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: #8063
-
arowser commented at 8:43 AM on May 25, 2016: contributor
Can one of the admins verify this patch?
- sipa merged this on May 25, 2016
- sipa closed this on May 25, 2016
- sipa referenced this in commit c49c825bd9 on May 25, 2016
- codablock referenced this in commit bd363dbbe3 on Sep 16, 2017
- codablock referenced this in commit 7f302e66bc on Sep 19, 2017
- codablock referenced this in commit 42a3e0d2d7 on Dec 21, 2017
- zkbot referenced this in commit 5a626317c7 on Mar 16, 2020
- DrahtBot locked this on Sep 8, 2021