-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add locks when querying chainActive #485
Conversation
1741217
to
0cba296
Compare
Only those that use chainActive
f3b7c64
to
5fb10cd
Compare
In the last few commits, I have updated the threadsafety annotations to work better with more recent versions of clang. With that, I have run the analysis and found the areas for cs_main that need locking. See this file and search for For the majority of cases, we will need to determine if we should
I am assuming for now we will continue to use exclusive locking. Small changes to the instrumentation will be necessary if we move to shared locking. Trying to fix all these warnings as part of this PR is probably "scope creep". A separate effort is also needed to add instrumentation for other (non-cs_main) mutexes. |
Great that lock held asserts are added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to test the code for some time after merge into dev
these changes implemented in combined PR: #559 |
Fixes Issue #482
The std::vector vChain within the CChain class is not thread safe. Various methods modify and query the vector with no synchronization. This fixes those found during testing.
TODO: