diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index fd5d781ca7eb..8bebde2d5cc2 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -442,7 +442,7 @@ cpu_switch(struct thread *old, struct thread *new, struct mtx *mtx) if (PCPU_GET(fpcurthread) == old) old->td_frame->tf_special.psr |= IA64_PSR_DFH; if (!savectx(oldpcb)) { - old->td_lock = mtx; + atomic_store_rel_ptr(&old->td_lock, mtx); #if defined(SCHED_ULE) && defined(SMP) /* td_lock is volatile */ while (new->td_lock == &blocked_lock)