Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
* Gate all exported primitives behind opt-in Cargo features and enable no features by default; downstream dependencies must explicitly enable the APIs they use.
* Remove `admission::FairShare` and its `admission` Cargo feature from the feature set.
* Remove the `asyncband::atomicbox` module and its `AtomicBox` and `AtomicOptionBox` types from the public API.
* Remove `Semaphore::try_acquire_and_forget`, `Semaphore::acquire_and_forget`, `Semaphore::try_acquire_owned_and_forget`, and `Semaphore::acquire_owned_and_forget`; acquire a permit and call its `forget` method instead.
* Rename `oneshot::Sender::is_closed` and `oneshot::Receiver::is_closed` to `is_disconnected`.
* Replace `Semaphore::forget` with `Semaphore::drain_permits` and `Semaphore::forget_exact` with `Semaphore::reduce_permits`; permit-level `forget` methods are unchanged.
* Raise the minimum supported Rust version from 1.85.0 to 1.86.0.
Expand Down
36 changes: 0 additions & 36 deletions asyncband/src/semaphore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@ impl Semaphore {
}
}

/// Attempts to acquire `n` permits from the semaphore without blocking.
///
/// This method is equivalent to successfully calling [`Semaphore::try_acquire`] and then
/// calling [`SemaphorePermit::forget`] on the returned permit.
pub fn try_acquire_and_forget(&self, permits: usize) -> bool {
self.s.try_acquire(permits)
}

/// Acquires `n` permits from the semaphore.
///
/// If the permits are not immediately available, this method will wait until they become
Expand Down Expand Up @@ -282,14 +274,6 @@ impl Semaphore {
SemaphorePermit { sem: self, permits }
}

/// Acquires `n` permits from the semaphore.
///
/// This method is equivalent to calling [`Semaphore::acquire`] and then calling
/// [`SemaphorePermit::forget`] on the returned permit.
pub async fn acquire_and_forget(&self, permits: usize) {
self.s.acquire(permits).await;
}

/// Attempts to acquire `n` permits from the semaphore without blocking.
///
/// The semaphore must be wrapped in an [`Arc`] to call this method.
Expand Down Expand Up @@ -326,16 +310,6 @@ impl Semaphore {
}
}

/// Attempts to acquire `n` permits from the semaphore without blocking.
///
/// The semaphore must be wrapped in an [`Arc`] to call this method.
///
/// This method is equivalent to successfully calling [`Semaphore::try_acquire_owned`] and
/// then calling [`OwnedSemaphorePermit::forget`] on the returned permit.
pub fn try_acquire_owned_and_forget(self: Arc<Self>, permits: usize) -> bool {
self.s.try_acquire(permits)
}

/// Acquires `n` permits from the semaphore.
///
/// The semaphore must be wrapped in an [`Arc`] to call this method.
Expand Down Expand Up @@ -378,16 +352,6 @@ impl Semaphore {
self.s.acquire(permits).await;
OwnedSemaphorePermit { sem: self, permits }
}

/// Acquires `n` permits from the semaphore.
///
/// The semaphore must be wrapped in an [`Arc`] to call this method.
///
/// This method is equivalent to calling [`Semaphore::acquire_owned`] and then calling
/// [`OwnedSemaphorePermit::forget`] on the returned permit.
pub async fn acquire_owned_and_forget(self: Arc<Self>, permits: usize) {
self.s.acquire(permits).await;
}
}

/// A permit from the semaphore.
Expand Down