[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: Add spinlocks lock type, based on GCC intrisincs
From:       Thiago Macieira <thiago () kde ! org>
Date:       2012-08-28 7:42:00
Message-ID: 1754246.g5o7k0f3AD () tjmaciei-mobl2
[Download RAW message or body]


On segunda-feira, 27 de agosto de 2012 20.29.52, Michael Pyne wrote:
> On Monday, August 27, 2012 20:18:34 Michael Pyne wrote:
> > On Tuesday, August 28, 2012 00:41:16 Thiago Macieira wrote:
> > > QBasicAtomicInt are permitted in unions. Besides, why do you want it in
> > > a
> > > union in the first place? You should not access the data that it holds
> > > *except* via the QBasicAtomicInt functions.
> > 
> > That would be the idea, yes (to use the public QBAI functions).
> > 
> > The problem with having it in a union was that it's a non-POD type
> > according to C++ 03 rules (or at least, that seemed to be the issue when
> > I had tried that initially).
> 
> Actually I take that back. I was using QAtomicInt, which had that problem.
> QBasicAtomicInt works just fine in the union... yay!

That's the whole point of QBasicAtomicInt: it's POD.

Anyway, you haven't explained why you need it in a union with something else. 
Are you accessing the data outside of QBasicAtomicInt? If so, that's wrong. if 
you're not, you probably don't need the union.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic