/// Unlocks the Resource and unblocks the tasks which were blocked during the call to lock
Unlocks the Resource and unblocks the tasks which were blocked during the call to lock
Unlocks the Resource and unblocks the tasks which were blocked during the call to lock
fn unlock(&self) -> Result<(), KernelError> {
        let is_preemptive = critical_section(|cs_token| {
            let pi_stack = &mut PiStackGlobal.borrow(cs_token).borrow_mut();
            if self.ceiling as i32 == pi_stack.system_ceiling {
                pi_stack.pop_stack()?;
                let mask = Self::get_pi_mask(self.ceiling);
                TaskManager
                    .borrow(cs_token)
                    .borrow_mut()
                    .unblock_tasks(mask);
            }
            #[cfg(feature = "system_logger")]
            {
                if logging::get_resource_unlock() {
                    logging::report(LogEventType::ResourceUnlock(get_curr_tid() as u32));
                }
            }
            Ok(TaskManager.borrow(cs_token).borrow_mut().is_preemptive)
        })?;
        schedule(is_preemptive);
        Ok(())
    }
fn unlock ( & self ) -> Result < ( ) , KernelError > { let is_preemptive = critical_section ( | cs_token | { let pi_stack = & mut PiStackGlobal . borrow ( cs_token ) . borrow_mut ( ) ; if self . ceiling as i32 == pi_stack . system_ceiling { pi_stack . pop_stack ( ) ? ; let mask = Self :: get_pi_mask ( self . ceiling ) ; TaskManager . borrow ( cs_token ) . borrow_mut ( ) . unblock_tasks ( mask ) ; } # [ cfg ( feature " " ) ] { if logging :: get_resource_unlock ( ) { logging :: report ( LogEventType :: ResourceUnlock ( get_curr_tid ( ) as u32 ) ) ; } } Ok ( TaskManager . borrow ( cs_token ) . borrow_mut ( ) . is_preemptive ) } ) ? ; schedule ( is_preemptive ) ; Ok ( ( ) ) }
Unlocks the Resource and unblocks the tasks which were blocked during the call to lock
Unlocks the Resource and unblocks the tasks which were blocked during the call to lock
&self