[英]What is the difference between PTHREAD_RECURSIVE_MUTEX_INITIALIZER and PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP?
When statically initializing a recursive mutex, what is the difference between 静态初始化递归互斥锁时,有什么区别
static pthread_mutex_t foo_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
and 和
static pthread_mutex_t foo_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
and why should I want the one instead of the other? 为什么我要一个而不是另一个呢?
"_NP" is meant as a hint that the feature is nonportable. “_NP”表示该功能不可移植。 In order to keep the hint there, you are best off to use the "_NP" version.
为了保持提示,最好使用“_NP”版本。
Other than that I suspect there is no difference. 除此之外,我怀疑没有区别。 Not 100% sure, though.
但不是100%肯定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.