[Development] QBasicMutex::lockInternal() race condition?

Thiago Macieira thiago.macieira at intel.com
Thu Sep 20 19:07:26 CEST 2012


On quinta-feira, 20 de setembro de 2012 16.50.18, Tony Van Eerd wrote:
> But we already did an acquire earlier when we got the d_ptr the first
> time.  All our instructions on id and waiters happens after that.
> 
> If we are worried about ABA on the d_ptr, hmmm, I'd need to think about
> that.

Right, we have an acquire before. Which means that, if the comparison 
succeeds, we've already acquired the fields that don't change.

If the comparison fails, however, we need the acquire because of the id. It 
could have changed. Maybe the Acquire should be moved there, which means the 
id should be an atomic too.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120920/d4fe8570/attachment.sig>


More information about the Development mailing list