This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug ports/11291] potential deadlock in sem_*wait and sem_post for MIPS architectures
- From: "jakub at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 17 Feb 2010 19:14:03 -0000
- Subject: [Bug ports/11291] potential deadlock in sem_*wait and sem_post for MIPS architectures
- References: <20100217150652.11291.mischa.jonker@viragelogic.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From jakub at redhat dot com 2010-02-17 19:14 -------
"+m" and "=m"/"0" is not recommended, you should really use "=m" (*mem) ... "m"
(*mem).
And all you need to fix is exactly this, the atomic_* insn takes care of other
threads accessing the same field.
Even volatile wouldn't change anything. You just load the value the field has
at some point in the current thread, compute the new value you want to use and then
atomic_* will succeed only if the memory has the same value as it had when it
has been loaded.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11291
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.