Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
'identifier' : 'thread' is only valid for data items of static extent
Remarks
You cannot use the thread attribute with an automatic variable, nonstatic data member, function parameter, or on function declarations or definitions.
Use the thread attribute for global variables, static data members, and local static variables only.
Example
The following example generates C2480:
// C2480.cpp
// compile with: /c
__declspec( thread ) void func(); // C2480
__declspec( thread ) static int i; // OK