Clarified an implementation choice.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10429 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_load_store.c b/drd/drd_load_store.c
index 6398dac..e123b5c 100644
--- a/drd/drd_load_store.c
+++ b/drd/drd_load_store.c
@@ -557,11 +557,14 @@
case Ist_CAS:
if (instrument)
{
- /* Just treat this as a read of the location. I believe
- this is equivalent to the previous logic, which
- observed bus-lock/unlock Ist_MBEs, and ignored all
- writes within sections bracketed by bus-lock and
- bus-unlock annotations. */
+ /*
+ * Treat compare-and-swap as a read. By handling atomic
+ * instructions as read instructions no data races are reported
+ * between conflicting atomic operations nor between atomic
+ * operations and non-atomic reads. Conflicts between atomic
+ * operations and non-atomic write operations are still reported
+ * however.
+ */
Int dataSize;
IRCAS* cas = st->Ist.CAS.details;
tl_assert(cas->addr != NULL);