|
Syntax #include <pthread.h> #include <sched.h> int pthread_set_mutexattr_default_np(int kind); Threadsafe: Yes Signal Safe: Yes |
The pthread_set_mutexattr_default_np() function sets the kind attribute in the default mutex attribute object. The default mutex attributes object is used when pthread_mutex_init() is called specifying a NULL pointer for the mutex attributes object parameter.
The kind set may be one of PTHREAD_MUTEX_NONRECURSIVE_NP or PTHREAD_MUTEX_RECURSIVE_NP.
The pthread_set_mutexattr_default_np() function does not effect any currently existing mutex attributes objects, nor does it effect the subsequent behavior of pthread_mutexattr_init() or the PTHREAD_MUTEX_INITIALIZER macro.
Calls to pthread_set_mutexattr_default_np() will change how the threads run-time creates default mutexes for all code running in the current process. Note that it is possible for you to negatively effect other code in your process that uses pthread mutexes by using this function.
Use of this function is not recommended because it can effect the creation of mutexes that your application doesn't directly own.
This function is not portable
None.
If pthread_set_mutexattr_default() was not successful, the error condition returned usually indicates one of the following errors. Under some conditions, the value returned could indicate an error other than those listed here.