线程私有数据
1.__thread : gcc内置的线程局部存储设施
__thread只能修饰POD类型
POD类型(plain old data),
与C兼容的原始数据,例如,结构和整型等C语言中的类型是 POD 类型,但带有用户定义的构造函数或虚函数的类则不是
__thread string t_obj1(“cppcourse”);
//
错误,不能调用对象的构造函数
__thread string* t_obj2 = new string;
//
错误,初始化只能是编译期常量
__thread string* t_obj3 = NULL;
// 正确