use crate::semaphore::PrioritySemaphore;
use alloc::sync::Arc;
#[derive(Debug)]
pub struct Permit {
root: Arc<PrioritySemaphore>,
}
impl Permit {
pub(crate) fn new(root: Arc<PrioritySemaphore>) -> Self {
Self { root }
}
}
impl Drop for Permit {
fn drop(&mut self) {
self.root.release_one();
}
}