This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
Remove ThreadSanitizer warnings #4579
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f9b30e4
EthereumPeerObserver::m_sync as shared_ptr
pirapira 0443dfc
Protect Peer::m_score and m_rating under atomic
pirapira 0ae6d6a
EthereumPeer::m_observer and m_hostData as weak pointers instead of s…
pirapira c22af66
Protect m_timer under x_runTimer
pirapira 9e51f90
Protect Host::m_nodeTable with a mutex
pirapira d38db0f
Remove a while() sleep in favor of a condition variable
pirapira bc76378
Peer::m_failedAttempts as atomic
pirapira fa26de3
Extract operations with m_nodeTable into separate methods
gumb0 463fb8d
Moving m_run.exchange(false) out of the guard, and fix the uncovered
pirapira c34498b
Rename m_timerSemaphore into m_timerReset
pirapira File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm afraid we have the same problem with
m_syncMutex
below. IfEthereumHost
gets destroyed beforeEthereumPeerObserver
mutex is destroyed with it... Not sure yet what to do with itm_tq
is destroyed with theClient
, also not sure ifEthereumPeers
can outliveClient
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.
(for myself) try to remove
m_syncMutex
.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.
Somehow I'm making other classes hold
m_tq
as a weak pointer.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.
And I was able to remove
m_syncMutex
and still seeing no warnings from ThreadSanitizer.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.
About
m_tq
, I decided to use shared/weak pointers.