How to define thread-local local static variables?

前端 未结 5 470
执笔经年
执笔经年 2020-12-09 16:48

How to define local static variables (that keeps its value between function calls) that are not shared among different threads?

I am looking for an answer both in C

5条回答
  •  渐次进展
    2020-12-09 17:20

    You can also use the C++11 thread local storage additions if you have access to C++11.

提交回复
热议问题