From: Bart Van Assche Date: Sat, 11 Jul 2009 14:35:59 +0000 (+0000) Subject: Clarified an implementation choice. X-Git-Tag: svn/VALGRIND_3_5_0~418 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f83d3907f3a9df999eee3dcdba25362a5c99718;p=thirdparty%2Fvalgrind.git Clarified an implementation choice. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10429 --- diff --git a/drd/drd_load_store.c b/drd/drd_load_store.c index 6398dac0d9..e123b5c31f 100644 --- a/drd/drd_load_store.c +++ b/drd/drd_load_store.c @@ -557,11 +557,14 @@ IRSB* DRD_(instrument)(VgCallbackClosure* const closure, 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);