Looks like this was forgotten when introducing kernel/cs_main ?
Also, there is a commit to export threadsafety.h from sync.h.
Looks like this was forgotten when introducing kernel/cs_main ?
Also, there is a commit to export threadsafety.h from sync.h.
All places that include sync.h will likely need threadsafety
annotations, so export them.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | hebasto |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
ACK faba08b5b4dd5dedb457db18696de6e15839c696
Also, there is a commit to export threadsafety.h from sync.h.
I’m not sure about that because thread safety annotations are mostly used in headers, and sync.h
can be needed to be included in source files only. For example, without that commit, node/utxo_snapshot.h
needs a replacement s/#include <sync.h>
/#include <threadsafety.h>
/.
sync.h can be needed to be included in source files only
No? If the header uses a Mutex
, it will need to include sync.h. Is there any place in the codebase that doesn’t use Mutex
?
Is there any place in the codebase that doesn’t use
Mutex
?
For example, node/utxo_snapshot.h
from this PR?
Well, I meant Mutex
or RecursiveMutex
, or whatever else is in sync.h
.
The point is that you can’t compile utxo_snapshot.h
without sync.h
, and any other place that uses symbols with theadsafety annotations from sync.h
, in which case including theadsafety.h again serves no purpose other than noise.
Well, I meant
Mutex
orRecursiveMutex
, or whatever else is insync.h
.The point is that you can’t compile
utxo_snapshot.h
withoutsync.h
It is job of <kernel/cs_main.h>
now, no?
and any other place that uses symbols with theadsafety annotations from
sync.h
, in which case including theadsafety.h again serves no purpose other than noise.
Agree. Probably the use case of <kernel/cs_main.h>
is the only counter example.
I think the only counter example (something that doesn’t need sync.h
directly or indirectly) is logging.h
, because it only needs threadsafety, see https://github.com/bitcoin/bitcoin/blob/d4c180ecc9aec5baa6c074f78e4d2c5e28b124ac/src/logging.h#L10
Though, I am not changing that in this pull.
Labels
Refactoring