diff options
author | Carl Lerche <me@carllerche.com> | 2020-10-09 10:02:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 10:02:55 -0700 |
commit | afe535283c68dec40c5fc7a810445e8c2380880f (patch) | |
tree | 41c0271db0ffc39662fac9a0cc957dee216a2bef /tokio/src/sync/batch_semaphore.rs | |
parent | ee597347c5e612611142ece09c79e55f2d243590 (diff) |
fs: future proof `File` (#2930)
Changes inherent methods to take `&self` instead of `&mut self`. This
brings the API in line with `std`.
This patch is implemented by using a `tokio::sync::Mutex` to guard the
internal `File` state. This is not an ideal implementation strategy
doesn't make a big impact compared to having to dispatch operations to a
background thread followed by a blocking syscall.
In the future, the implementation can be improved as we explore async
file-system APIs provided by the operating-system (iocp / io_uring).
Closes #2927
Diffstat (limited to 'tokio/src/sync/batch_semaphore.rs')
-rw-r--r-- | tokio/src/sync/batch_semaphore.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tokio/src/sync/batch_semaphore.rs b/tokio/src/sync/batch_semaphore.rs index d09528be..0b50e4f7 100644 --- a/tokio/src/sync/batch_semaphore.rs +++ b/tokio/src/sync/batch_semaphore.rs @@ -1,3 +1,4 @@ +#![cfg_attr(not(feature = "sync"), allow(unreachable_pub, dead_code))] //! # Implementation Details //! //! The semaphore is implemented using an intrusive linked list of waiters. An |