是gettimeofday的功能线程的Linux安全吗?
问题描述:
目前的时间必须在全球范围内存储,以便gettimeofday的工作,但是我不知道,如果函数修改任何全局状态,以便并发执行是不确定的。
The current time must be stored globally in order for gettimeofday to work, however I am not sure if the function modifies any global state so that concurrent execution is undefined.
答
gettimeofday的是线程安全的。
gettimeofday is thread safe.
的(POSIX)中列出的功能here可能不是,gettimeofday的是不是其中之一。
The (posix) functions listed here might not be, gettimeofday is not one of them.