async-rs / async-rs/async-std

Add an owned variant of RwLockReadGuard and RwLockWriteGuard

Open
#991 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

When locking an `Arc>` I can call [`lock_arc`](https://docs.rs/async-std/1.10.0/async_std/sync/struct.Mutex.html#method.lock_arc), which returns an extremely handy owned `MutexGuardArc`.

I would expect an `Arc>` to provide `read_arc` and `write_arc` to return owned guards as well, unfortunately these methods do not exist. They should be possible to implement, since the tokio project [does provide such methods](https://docs.rs/tokio/1.12.0/tokio/sync/struct.RwLock.html#method.read_owned).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.