From: Alex Rousskov Date: Thu, 31 Mar 2011 20:04:20 +0000 (-0600) Subject: Added initial __sync_fetch_and_and support. X-Git-Tag: take06~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26872536eb50ac5324bcb458c35792450acad86c;p=thirdparty%2Fsquid.git Added initial __sync_fetch_and_and support. --- diff --git a/src/ipc/AtomicWord.h b/src/ipc/AtomicWord.h index 7b60a2c81c..5d30b7d27d 100644 --- a/src/ipc/AtomicWord.h +++ b/src/ipc/AtomicWord.h @@ -20,6 +20,9 @@ public: bool swap_if(const int comparand, const int replacement) { return __sync_bool_compare_and_swap(&value, comparand, replacement); } + /// v1 = value; value &= v2; return v1; + Value fetchAndAnd(const Value v2) { return __sync_fetch_and_and(&value, v2); } + // TODO: no need for __sync_bool_compare_and_swap here? bool operator ==(int v2) { return __sync_bool_compare_and_swap(&value, v2, value); }