Fix Clock::LockLock setting we_disabled_interrupts before disabling interrupts.

This commit is contained in:
Jonas 'Sortie' Termansen 2018-08-06 21:17:53 +02:00
parent 5be7b52422
commit ab228e1062
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2016, 2017 Jonas 'Sortie' Termansen. * Copyright (c) 2013, 2016, 2017, 2018 Jonas 'Sortie' Termansen.
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -78,8 +78,13 @@ void Clock::LockClock()
{ {
if ( clock_callable_from_interrupt ) if ( clock_callable_from_interrupt )
{ {
if ( (we_disabled_interrupts = Interrupt::IsEnabled()) ) if ( Interrupt::IsEnabled() )
{
Interrupt::Disable(); Interrupt::Disable();
we_disabled_interrupts = true;
}
else
we_disabled_interrupts = false;
} }
else else
kthread_mutex_lock(&clock_mutex); kthread_mutex_lock(&clock_mutex);