Skip to content
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

Add reference-counted versions of RwLock guards #47

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

Jules-Bertholet
Copy link
Collaborator

@Jules-Bertholet Jules-Bertholet commented May 29, 2023

Fixes #33

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rwlock.rs file is getting to be a bit long; I think it should be split into multiple files. As a rule of thumb, a single module shouldn't be more than 1000 lines.

(I'm busy for the time being and won't be able to take a more in depth look until the weekend).

src/rwlock.rs Outdated Show resolved Hide resolved
src/rwlock.rs Outdated Show resolved Hide resolved
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&**self, f)
}
}

impl<T: fmt::Display + ?Sized> fmt::Display for RwLockUpgradableReadGuard<'_, T> {
#[inline]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why you've inlined several methods here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency with the equivalent trivial methods on the Arc guards. I can remove them if you like

src/rwlock/futures.rs Outdated Show resolved Hide resolved
Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@notgull notgull merged commit 936e046 into smol-rs:master Jun 14, 2023
@Jules-Bertholet Jules-Bertholet deleted the arc-rwlock-guards branch June 14, 2023 04:19
@notgull notgull mentioned this pull request Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add owned variants of RwLock guards
2 participants