sync: add OwnedSemaphorePermit::semaphore (#5618)

This commit is contained in:
Alexander van Ratingen
2023-04-15 20:55:39 +02:00
committed by GitHub
parent fc1e03f91b
commit 3b16564ce0
+5
View File
@@ -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<'_> {