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