-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Revert "Use std::sync::Condvar (#1732)" #9392
Revert "Use std::sync::Condvar (#1732)" #9392
Conversation
It looks like @ordian signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
@@ -202,8 +202,8 @@ struct Verification<K: Kind> { | |||
verifying: Mutex<VecDeque<Verifying<K>>>, | |||
verified: Mutex<VecDeque<K::Verified>>, | |||
bad: Mutex<HashSet<H256>>, | |||
more_to_verify: SMutex<()>, | |||
empty: SMutex<()>, | |||
more_to_verify: Mutex<()>, |
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.
It seems like these locks were previously added so that they could be used with std::sync::Condvar
. Previously the Condvar
waited on unverified
. Do you think we could remove these?
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 question! Did that at first, but then I saw another PR using more_to_verify
, and it wasn't obvious if they can be safely removed. Anyway, it seems to work w/o them, so I'm going to push another commit with the removal.
3c3c6f4
to
45dafaa
Compare
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.
lgtm
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.
LGTM
wow, reverting a 26 months old PR 👍 |
Reverts #1732. This would hopefully allow us to detect deadlocks via
--feature "deadlock_detection"
.parking_lot_core
now uses WaitOnAddress/WakeByAddress on Windows, so I guess the reason not to useparking_lot::Condvar
is no longer relevant.