[Prev] [Contents] [Next]

pthread_set_mutexattr_default_np()--Set Default Mutex Attributes Object Kind Attribute

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

Parameters

kind
(Input) Variable containing the kind attribute.

Authorities and Locks

None.

Return Value

0
pthread_set_mutexattr_default() was successful.
value
pthread_set_mutexattr_default() was not successful. value is set to indicate the error condition.

Error Conditions

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.

[EINVAL]
The value specified for the argument is not correct.

Related Information



[Prev] [Contents] [Next]
Copyright © 1998, IBM Corporation. All rights reserved.
Comments? Contact
rchthrds@us.ibm.com