[英]Is std::polar thread safe?
Is the function std::polar()
thread safe? 函数
std::polar()
安全?
I would like to call the #pragma
directive on a for that uses it inside. 我想在一个内部使用它的
#pragma
指令。
Yes, std::polar
is thread-safe (for some definition of thread-safe). 是的,
std::polar
是线程安全的(对于某些线程安全的定义)。 See [res.on.data.races]/3
: 见
[res.on.data.races]/3
:
A C++ standard library function shall not directly or indirectly modify objects (1.10) accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's non- const arguments, including this.
C ++标准库函数不应直接或间接修改除当前线程以外的线程可访问的对象(1.10),除非通过函数的非const参数直接或间接访问对象,包括此参数。
Since std::polar
only takes const parameters, it does not modify any objects outside the thread that it is called from. 由于
std::polar
只接受const参数,因此它不会修改调用它的线程之外的任何对象。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.