mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-18 00:00:09 +02:00
sync: add OwnedSemaphorePermit::semaphore (#5618)
This commit is contained in:
@@ -676,6 +676,11 @@ impl OwnedSemaphorePermit {
|
||||
self.permits += other.permits;
|
||||
other.permits = 0;
|
||||
}
|
||||
|
||||
/// Returns the [`Semaphore`] from which this permit was acquired.
|
||||
pub fn semaphore(&self) -> &Arc<Semaphore> {
|
||||
&self.sem
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for SemaphorePermit<'_> {
|
||||
|
||||
Reference in New Issue
Block a user