mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-30 08:53:31 +00:00
Allow dynamically borrowed RwLock
guards
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
3dd6f71936
commit
11e4984df2
@ -364,11 +364,11 @@ impl Credentials_ {
|
||||
}
|
||||
|
||||
// ******* Supplementary groups methods *******
|
||||
pub(super) fn groups(&self) -> RwLockReadGuard<'_, BTreeSet<Gid>> {
|
||||
pub(super) fn groups(&self) -> RwLockReadGuard<BTreeSet<Gid>> {
|
||||
self.supplementary_gids.read()
|
||||
}
|
||||
|
||||
pub(super) fn groups_mut(&self) -> RwLockWriteGuard<'_, BTreeSet<Gid>> {
|
||||
pub(super) fn groups_mut(&self) -> RwLockWriteGuard<BTreeSet<Gid>> {
|
||||
self.supplementary_gids.write()
|
||||
}
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ impl<R: TRights> Credentials<R> {
|
||||
///
|
||||
/// This method requies the `Read` right.
|
||||
#[require(R > Read)]
|
||||
pub fn groups(&self) -> RwLockReadGuard<'_, BTreeSet<Gid>> {
|
||||
pub fn groups(&self) -> RwLockReadGuard<BTreeSet<Gid>> {
|
||||
self.0.groups()
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ impl<R: TRights> Credentials<R> {
|
||||
///
|
||||
/// This method requires the `Write` right.
|
||||
#[require(R > Write)]
|
||||
pub fn groups_mut(&self) -> RwLockWriteGuard<'_, BTreeSet<Gid>> {
|
||||
pub fn groups_mut(&self) -> RwLockWriteGuard<BTreeSet<Gid>> {
|
||||
self.0.groups_mut()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user