像这样。 struct some_struct { // Other fields ….. __thread int tl; } 我试图这样做,但编译器给了我这个错误。 ./cv.h:16:2: error: ‘__thread’ is only allowed on variable declarations __thread int tl;