-
Notifications
You must be signed in to change notification settings - Fork 407
Implement lockorder checking on RwLocks in debug_sync #1352
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
Implement lockorder checking on RwLocks in debug_sync #1352
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1352 +/- ##
==========================================
+ Coverage 90.57% 91.20% +0.62%
==========================================
Files 72 72
Lines 40082 43782 +3700
==========================================
+ Hits 36306 39933 +3627
- Misses 3776 3849 +73
Continue to review full report at Codecov.
|
lightning/src/debug_sync.rs
Outdated
@@ -205,6 +213,7 @@ impl<T: Sized> Deref for RwLockReadGuard<'_, T> { | |||
|
|||
impl<T: Sized> Drop for RwLockReadGuard<'_, T> { | |||
fn drop(&mut self) { | |||
if !self.first_lock { return; } |
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.
Couldn't the first read lock be released before later ones?
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.
In theory, yea, in practice it should be exceedingly rare cause ~all our locks are RAII. I'll just add a comment noting that its a limitation.
943d228
to
e0a57b2
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.
seems fine as far as I can tell and test
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 squash
e0a57b2
to
35c8718
Compare
Squashed without change. |
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.
Re-ACKing
No description provided.