From kde-core-devel Tue Aug 28 00:29:52 2012 From: Michael Pyne Date: Tue, 28 Aug 2012 00:29:52 +0000 To: kde-core-devel Subject: Re: Review Request: Add spinlocks lock type, based on GCC intrisincs Message-Id: <1388978.oK7RDt27RB () midna> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=134612127927127 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart3498516.4bNmiFVDAP" --nextPart3498516.4bNmiFVDAP Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" On Monday, August 27, 2012 20:18:34 Michael Pyne wrote: > On Tuesday, August 28, 2012 00:41:16 Thiago Macieira wrote: > > On segunda-feira, 27 de agosto de 2012 18.20.15, Michael Pyne wrote: > > > > Please use the Qt atomic types. Until GCC 4.7, they generate better > > > > code. > > > > > > I agree, the reason it wasn't that way initially is mentioned in the > > > discussion on the bug (but basically because you can't simply put > > > QBasicAtomicInt in the union used to store the different lock types that > > > are possible). > > > > Why not? > > > > 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! Regards, - Michael Pyne --nextPart3498516.4bNmiFVDAP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAABCAAGBQJQPBEAAAoJEAuvDJx7aunyyj4QAKiOUCs7VCzShdpy3PoMJV+E 1tKq+aANMFq9qJRn9VO96dvywHFf82Kwz5+uKx0qj9TKE9qjAlXdVTF++bOlwnk9 xWHnIDhaHuN926XFf+NCl7hFDzcp76oJxvrVE1yw9N83XqS5iiHYk09aJeGFD3Sa q3KtDkhxf1tEGFNVJHRcyviBUzHH9hd/wIfA7yoKRrgneyGwBcwul0GTgQo8Er11 I0wzd/EXUpb4aeXKaLQkqnPavX4noeJ38fuKkUfDYOeCVIvlLajyXHFRIAYBmOnk i1VQ0yd0xfRC/Kz7rlgBRW6mLbr2TYPJ0+8fAvY0m9brP2LOeYpQSH2VS+Jza/ZL rJlEr3FKD2q99LXFcLQ0de1MSl6UlibiRsoZCDWDkvd585cczQeTpWqQp/mPBSz9 sjn6jPPzO98qsPqNeCln3Bb2aj+eBzQUAvm7aK4zq/l1UZzSbesT84MUTh1nPb70 U6f2IqKw2U5ixXRsC2FfqEVRxJrsNmRBfzx1AYUfkN44Wu1dH0XjdPiUzufjVpGk wbj2ieNxuSQiEXVT0Fvrg13DelwRgDfBpeu5QkDQDKoh9wW1dxtsCIq9saweS8tg VzBC8otWI/VqT05s9mJQx7/l+Fuwt55/w6F0EssTFiDdaZDI4v4Pk9/uU04kjcU1 GpyePdsJznDDshl2maho =e6q+ -----END PGP SIGNATURE----- --nextPart3498516.4bNmiFVDAP--