What is the difference between PTHREAD_RECURSIVE_MUTEX_INITIALIZER and PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP?

With static initialization of 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 use this instead of another?

+6
source share
1 answer

"_ NP" means a hint that this function is not portable. To save the hint, you better use the "_NP" version.

In addition, I suspect that there is no difference. Not 100% sure.

+6
source

All Articles