Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2010 02:32:07 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203054 - head/sys/ia64/ia64
Message-ID:  <201001270232.o0R2W7Rl076115@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Wed Jan 27 02:32:07 2010
New Revision: 203054
URL: http://svn.freebsd.org/changeset/base/203054

Log:
  In cpu_switch(), use an atomic operation to set the td_lock
  of the old thread to the mutex that's passed.
  
  Pointed out by: attilio, jhb

Modified:
  head/sys/ia64/ia64/machdep.c

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Wed Jan 27 00:34:52 2010	(r203053)
+++ head/sys/ia64/ia64/machdep.c	Wed Jan 27 02:32:07 2010	(r203054)
@@ -442,7 +442,7 @@ cpu_switch(struct thread *old, struct th
 	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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001270232.o0R2W7Rl076115>