Are the time functions of MSVC thread-safe?

前端 未结 4 537
遥遥无期
遥遥无期 2020-12-18 23:59

In case of Linux, for time functions we have a _r versions Ex: localtime has localtime_r, but in Windows I am unable to find some such functions. Are the Windows time functi

4条回答
  •  Happy的楠姐
    2020-12-19 00:43

    On windows the non-_r functions are thread safe because they use thread-local storage for the buffer. See e.g. http://msdn.microsoft.com/en-us/library/bf12f0hc(VS.80).aspx

提交回复
热议问题