Review Request: Add spinlocks lock type, based on GCC intrisincs
thiago at kde.org
Tue Aug 28 08:42:00 BST 2012
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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: This is a digitally signed message part.
More information about the kde-core-devel