archive mirror
 help / color / mirror / Atom feed
From: Raj Inguva <>
To: Kirill Korotaev <>
Subject: Re: atomic_set & gcc. atomicity question
Date: Thu, 31 Jul 2003 16:16:57 +0530	[thread overview]
Message-ID: <> (raw)

> #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' .

      reply	other threads:[~2003-07-31 10:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-31 10:00 atomic_set & gcc. atomicity question "Kirill Korotaev" 
2003-07-31 10:46 ` Raj Inguva [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).