[kernel] rearrange the order the critical section count is modified
there was a slight race where the critical section count was bumped but interrupts had not been disabled yet. Reverse the order of operations so that at worse interrupts are disabled and the count == 0.
This commit is contained in:
@@ -133,9 +133,9 @@ extern int critical_section_count;
|
||||
|
||||
static inline __ALWAYS_INLINE void enter_critical_section(void)
|
||||
{
|
||||
critical_section_count++;
|
||||
if (critical_section_count == 1)
|
||||
if (critical_section_count == 0)
|
||||
arch_disable_ints();
|
||||
critical_section_count++;
|
||||
}
|
||||
|
||||
static inline __ALWAYS_INLINE void exit_critical_section(void)
|
||||
|
||||
Reference in New Issue
Block a user