1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

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

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
* 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 ( (we_disabled_interrupts = Interrupt::IsEnabled()) )
if ( Interrupt::IsEnabled() )
{
Interrupt::Disable();
we_disabled_interrupts = true;
}
else
we_disabled_interrupts = false;
}
else
kthread_mutex_lock(&clock_mutex);