Merge remote-tracking branch 'origin/thread_scheduler' into thread_scheduler
# Conflicts: # src/kernel/synch.rs
This commit is contained in:
@@ -111,7 +111,7 @@ impl<'t> Lock<'_> {
|
||||
pub fn release(&mut self, machine: &mut Machine, scheduler: &mut Scheduler, current_thread: Rc<RefCell<Thread>>) {
|
||||
let old_status = machine.interrupt.set_status(InterruptOff);
|
||||
|
||||
if self.held_by_current_thread(current_thread) {
|
||||
if self.is_held_by_current_thread(current_thread) {
|
||||
if self.waiting_queue.peek() != None {
|
||||
self.owner = self.waiting_queue.pop().unwrap();
|
||||
scheduler.ready_to_run(Rc::clone(&self.owner));
|
||||
@@ -123,7 +123,7 @@ impl<'t> Lock<'_> {
|
||||
machine.interrupt.set_status(old_status);
|
||||
}
|
||||
|
||||
pub fn held_by_current_thread(&mut self, current_thread: Rc<RefCell<Thread>>) -> bool {
|
||||
pub fn is_held_by_current_thread(&mut self, current_thread: Rc<RefCell<Thread>>) -> bool {
|
||||
Rc::ptr_eq(&self.owner, ¤t_thread)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user