Re: [Development] Q_GLOBAL_STATIC_WITH_INITIALIZER is harmful: please stop using it! (long)

2012-03-16 Thread Thiago Macieira
On sexta-feira, 16 de março de 2012 12.38.57, Thiago Macieira wrote: > Type *object() > { > static Type *pointer; > if (!pointer) { > pointer = new Type; > initializer > } Add here: return pointer; > } > > that is equally as thread-safe as the macro. And it's a lot

Re: [Development] Q_GLOBAL_STATIC_WITH_INITIALIZER is harmful: please stop using it! (long)

2012-03-16 Thread Thiago Macieira
Ok, some people requested an explanation. I will provide one, but I don't expect many will understand it or even read until the end of this email, so if you don't get it, you'll have to trust me (which is the exact same result as not giving an explanation). First, two public announcements: 1) The

[Development] Q_GLOBAL_STATIC_WITH_INITIALIZER is harmful: please stop using it!

2012-03-15 Thread Thiago Macieira
-- 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 signature.asc Description: This is a digitally signed message part.