是gettimeofday的功能线程的Linux安全吗? [英] Is the gettimeofday function thread safe in Linux?

查看:1469
本文介绍了是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)中列出的功能<一个href=\"http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html#tag_02_09_01\">here可能不是,gettimeofday的是不是其中之一。

The (posix) functions listed here might not be, gettimeofday is not one of them.

这篇关于是gettimeofday的功能线程的Linux安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆