views:

124

answers:

1

http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Thread_002dLocal.html

Documents __thread

yet my g++ complains that __thread is not supported on my arch (Leopard on Macbookpro).

Why is this? And how do I get around it?

+2  A: 

I believe that page is just an Apple stylesheet slapped on the standard GCC manual. Notice the .so instead of .dylib in Mac OS X.

So it's entirely possible that gcc on Mac doesn't support __thread. You need to use pthread_setspecific manually.

(This problem has been filed as a bug.)

KennyTM