critical_{enter, exit}: add missing compiler barrier

Reported by:	markj
This commit is contained in:
Matt Macy 2018-07-08 19:35:29 +00:00
parent 952dd10db4
commit 3843df3fdc

View File

@ -238,6 +238,7 @@ critical_enter(void)
td = (struct thread_lite *)curthread;
td->td_critnest++;
__compiler_membar();
}
static __inline void
@ -248,6 +249,7 @@ critical_exit(void)
td = (struct thread_lite *)curthread;
KASSERT(td->td_critnest != 0,
("critical_exit: td_critnest == 0"));
__compiler_membar();
td->td_critnest--;
__compiler_membar();
if (__predict_false(td->td_owepreempt))