Date: Fri, 24 Mar 2006 20:43:57 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93945 for review Message-ID: <200603242043.k2OKhvZX012264@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93945 Change 93945 by jhb@jhb_twclab on 2006/03/24 20:43:26 The volatile cast didn't work on amd64 for some reason (gcc bug?). Just make the td_state member of struct thread volatile. Affected files ... .. //depot/projects/smpng/sys/kern/kern_mutex.c#120 edit .. //depot/projects/smpng/sys/sys/proc.h#168 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_mutex.c#120 (text+ko) ==== @@ -551,14 +551,8 @@ if (m != &Giant && TD_IS_RUNNING(owner)) { #endif turnstile_release(&m->mtx_object); - - /* - * Inline expansion of TD_IS_RUNNING(owner) to - * force volatile. - */ while (mtx_rawowner(m) == owner && - (volatile enum _td_state)owner->td_state == - TDS_RUNNING) { + TD_IS_RUNNING(owner)) { cpu_spinwait(); } continue; ==== //depot/projects/smpng/sys/sys/proc.h#168 (text+ko) ==== @@ -311,7 +311,7 @@ * or already have been set in the allocator, constructor, etc. */ struct pcb *td_pcb; /* (k) Kernel VA of pcb and kstack. */ - enum _td_state { + volatile enum { TDS_INACTIVE = 0x0, TDS_INHIBITED, TDS_CAN_RUN,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603242043.k2OKhvZX012264>