Skip to content

Commit

Permalink
优化了代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiichen committed Aug 24, 2023
1 parent 0ae8dfc commit 2414685
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions kernel/src/libs/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,7 @@ impl<'rwlock, T> Drop for RwLockWriteGuard<'rwlock, T> {
self.inner
.lock
.fetch_and(!(WRITER | UPGRADED), Ordering::Release);
if let Some(_) = self.irq_guard {
// 自动 drop 包含的 irq_guard,恢复中断
self.irq_guard = None;
}
self.irq_guard.take();
ProcessManager::current_pcb().preempt_enable();
}
}

0 comments on commit 2414685

Please sign in to comment.