Syntax error in SWIG using __thread keyword

Posted by user366838 on Stack Overflow See other posts from Stack Overflow or by user366838
Published on 2010-06-15T01:58:50Z Indexed on 2010/06/15 2:02 UTC
Read the original article Hit count: 283

Filed under:
|

I am trying to make some code thread safe for use with pthreads. This code is written in C++, but is linked to using SWIG. g++ compiles this correctly, but when swig tries to create a wrapper, I get:

fast_alloc.hh:109: Error: Syntax error in input(3)

The original, unsafe code that compiles correctly is:

static void *freeLists[Num_Buckets];

and the error occurs when I change it to:

static __thread void *freeLists[Num_Buckets];

I have made other parts thread safe adding "__thread", for example, this works:

static __thread unsigned newCount[Num_Buckets];

© Stack Overflow or respective owner

Related posts about c++

Related posts about swig