Re: atomic_set & gcc. atomicity question

From: Raj Inguva (rajsk@in.ibm.com)
Date: Thu Jul 31 2003 - 05:46:57 EST


> #define atomic_set(v,i) (((v)->counter) = (i))

'v' is of type atomic_t which is a structure.

> If we call atomic_set() with constant 2nd argument it's ok - it's a > simple write to var. But what if we do atomic_set(var, var1+var2)?

It will expand to (((var)->counter) = (var1+var2))

'counter' is 'volatile' .
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:49 EST