-
Notifications
You must be signed in to change notification settings - Fork 21
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
refactor(bdev/lock): add range lock trait #51
Conversation
2a64752
to
dfbc4e0
Compare
|
||
/// Allows gaining exclusive access over a block range. | ||
/// # Warning | ||
/// Due to the lack of async drop the range lock must be |
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 wonder if we can still release in the drop method, just not wait for it - and then the caller may decide to either wait or just allow the drop to do it if it doesn't care about waiting for unlock to complete, wdyt @dsavitskiy ?
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.
As I understand this drop part - since we have nothing custom to do in Drop, and the allocated heap memory will be anyway freed by default drop, it seems ok to wait for unlock to complete.
dfbc4e0
to
c3883e7
Compare
What's the rationale for this change? Perhaps you can update in PR description. |
done |
|
||
/// Allows gaining exclusive access over a block range. | ||
/// # Warning | ||
/// Due to the lack of async drop the range lock must be |
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.
As I understand this drop part - since we have nothing custom to do in Drop, and the allocated heap memory will be anyway freed by default drop, it seems ok to wait for unlock to complete.
c3883e7
to
d0e9602
Compare
ce34760
to
3214ded
Compare
Signed-off-by: Tiago Castro <[email protected]>
d0e9602
to
e65eaa3
Compare
I ended up not requiring this, so closing it for now. |
Makes the range locking an interface which can be implemented by different types.