summaryrefslogtreecommitdiffstats
path: root/vendor/gix-features/src/threading.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gix-features/src/threading.rs')
-rw-r--r--vendor/gix-features/src/threading.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/gix-features/src/threading.rs b/vendor/gix-features/src/threading.rs
index 2b33386d2..5f92ba2a8 100644
--- a/vendor/gix-features/src/threading.rs
+++ b/vendor/gix-features/src/threading.rs
@@ -30,6 +30,11 @@ mod _impl {
v.write()
}
+ /// Get a mutable reference to the underlying data, with semantics similar to [Arc::make_mut()].
+ pub fn make_mut<T: Clone>(this: &mut OwnShared<T>) -> &mut T {
+ OwnShared::make_mut(this)
+ }
+
/// Get a mutable reference through a [`Mutable`] for read-write access.
pub fn lock<T>(v: &Mutable<T>) -> parking_lot::MutexGuard<'_, T> {
v.lock()
@@ -75,6 +80,11 @@ mod _impl {
v.borrow_mut()
}
+ /// Get a mutable reference to the underlying data, with semantics similar to [Rc::make_mut()].
+ pub fn make_mut<T: Clone>(this: &mut OwnShared<T>) -> &mut T {
+ OwnShared::make_mut(this)
+ }
+
/// Get a mutable reference through a [`Mutable`] for read-write access.
pub fn lock<T>(v: &Mutable<T>) -> RefMut<'_, T> {
v.borrow_mut()