On 2011-10-05 09:08, Paolo Bonzini wrote: > On 10/04/2011 07:26 PM, Jan Kiszka wrote: >> Looks like a start. But I would avoid macros and go for (static inline) >> functions where possible. And initialization should be explicit (so that >> you can start using TLS already inside constructors). > > Here is the patch I wrote to do more or less the same thing, plus > Windows support. It's a bit different in that I wrote a macro that can > be used as lvalue.
Yeah, it probably makes sense to build the abstractions around __thread so that - one day - we can drop the legacy wrappers. Just do not prepend "tls__" in the gcc model (there is also some inconsistency with prefixes in patch 3). And avoid leading "_" unless they are dictated by the platform. And patch 3 needs to update darwin-user/main.c as well. > > It doesn't let you use TLS inside constructors, however, unless you use > constructor priorities. What is the default priority of constructors BTW? You picked the highest, will others that do not specify one have the same? Then we could also define a QEMU_CONSTRUCTOR wrapper with a lower priority. Jan
signature.asc
Description: OpenPGP digital signature