-
Notifications
You must be signed in to change notification settings - Fork 38.7k
addrman: Add Clang thread safety annotations for variables guarded by CAddrMan.cs #13115
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
Conversation
| The last travis run for this pull request was 84 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened. |
|
@MarcoFalke Would you mind reviewing this one? Should hopefully be trivial :-) |
|
utACK 4f04bda90e113cd596b019c05d6a5cb3ac4be540 |
|
Should squash or invert commit order otherwise 1st commit is broken? Also why rename |
4f04bda to
0179bc0
Compare
|
@promag Fixed. Please re-review :-) |
e06b3fc to
d1785a5
Compare
|
Unrelated feature_notifications.py failure in appveyor: |
|
nits:
|
d1785a5 to
3e9f6c8
Compare
|
@promag Thanks for the quick review. Feedback addressed. Please re-review :-) |
|
@practicalswift could drop these So: diff --git a/src/addrman.h b/src/addrman.h
index a36f7ea10..0d9081252 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -192,31 +192,31 @@ private:
mutable CCriticalSection cs;
//! last used nId
- int nIdCount;
+ int nIdCount GUARDED_BY(cs);
//! table with information about all nIds
- std::map<int, CAddrInfo> mapInfo;
+ std::map<int, CAddrInfo> mapInfo GUARDED_BY(cs);
//! find an nId based on its network address
- std::map<CNetAddr, int> mapAddr;
+ std::map<CNetAddr, int> mapAddr GUARDED_BY(cs);
//! randomly-ordered vector of all nIds
- std::vector<int> vRandom;
+ std::vector<int> vRandom GUARDED_BY(cs);
// number of "tried" entries
- int nTried;
+ int nTried GUARDED_BY(cs);
//! list of "tried" buckets
- int vvTried[ADDRMAN_TRIED_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE];
+ int vvTried[ADDRMAN_TRIED_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE] GUARDED_BY(cs);
//! number of (unique) "new" entries
- int nNew;
+ int nNew GUARDED_BY(cs);
//! list of "new" buckets
- int vvNew[ADDRMAN_NEW_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE];
+ int vvNew[ADDRMAN_NEW_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE] GUARDED_BY(cs);
//! last time Good was called (memory only)
- int64_t nLastGood;
+ int64_t nLastGood GUARDED_BY(cs);
//! Holds addrs inserted into tried table that collide with existing entries. Test-before-evict discipline used to resolve these collisions.
std::set<int> m_tried_collisions; |
|
@promag I'm not sure I follow here. Is you suggestion to drop all the What am I missing? :-) |
|
@practicalswift right, sorry about last comment. ACK 3e9f6c8. Please update PR title and description. |
|
@MarcoFalke Would you mind re-reviewing your previous utACK? :-) |
|
utACK 3e9f6c8 |
…les guarded by CAddrMan.cs 3e9f6c8 Add missing locks and locking annotations for CAddrMan (practicalswift) Pull request description: * Add Clang thread safety annotations for variables guarded by `CAddrMan.cs ` * Add missing `CAddrMan.cs ` locks Tree-SHA512: c78d56d56eb63a4469333c04c95317545a8f97d5e3a36ff2699ee4a91a6433d416221eed6c5ff168e1e31f6936c2ae101a4c60b635f2b2309f40e3d66a727322
…eler connections to existing outbound netgroups ccb6a4a [addrman] Improve collision logging and address nits (Suhas Daftuar) aa3c805 [addrman] Ensure collisions eventually get resolved (Suhas Daftuar) efd1d6a [net] feeler connections can be made to outbound peers in same netgroup (Suhas Daftuar) afcffc4 [addrman] Improve tried table collision logging (Suhas Daftuar) Pull request description: Two pretty direct back ports for the address manager. Coming from bitcoin#13115 and bitcoin#15486. ACKs for top commit: random-zebra: rebase utACK ccb6a4a, and merging... Tree-SHA512: 89d42b3164f92fcee69bc981c7e0887cab09820088732297dbcadbf4ccfc3257e9564ef2b394205f3153c8a03e4c0a0e8145b1c291e8cd980dc06b0ffa65a28c
zcash: cherry picked from commit 3e9f6c8 zcash: bitcoin/bitcoin#13115
zcash: cherry picked from commit 3e9f6c8 zcash: bitcoin/bitcoin#13115
… variables guarded by CAddrMan.cs 3e9f6c8 Add missing locks and locking annotations for CAddrMan (practicalswift) Pull request description: * Add Clang thread safety annotations for variables guarded by `CAddrMan.cs ` * Add missing `CAddrMan.cs ` locks Tree-SHA512: c78d56d56eb63a4469333c04c95317545a8f97d5e3a36ff2699ee4a91a6433d416221eed6c5ff168e1e31f6936c2ae101a4c60b635f2b2309f40e3d66a727322
… variables guarded by CAddrMan.cs 3e9f6c8 Add missing locks and locking annotations for CAddrMan (practicalswift) Pull request description: * Add Clang thread safety annotations for variables guarded by `CAddrMan.cs ` * Add missing `CAddrMan.cs ` locks Tree-SHA512: c78d56d56eb63a4469333c04c95317545a8f97d5e3a36ff2699ee4a91a6433d416221eed6c5ff168e1e31f6936c2ae101a4c60b635f2b2309f40e3d66a727322
CAddrMan.csCAddrMan.cslocks