linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raj Inguva <rajsk@in.ibm.com>
To: Kirill Korotaev <kksx@mail.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: atomic_set & gcc. atomicity question
Date: Thu, 31 Jul 2003 16:16:57 +0530	[thread overview]
Message-ID: <3F28F3A1.B7114CD@in.ibm.com> (raw)
In-Reply-To: E19iAEA-0006Fy-00.kksx-mail-ru@f6.mail.ru

> #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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=3F28F3A1.B7114CD@in.ibm.com \
    --to=rajsk@in.ibm.com \
    --cc=kksx@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).