Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

pthread_mutexattr_create(3)

pthread_mutexattr_getkind_np(3)

pthread_mutexattr_setkind_np(3)

pthread_mutex_lock(3)

pthread_mutex_trylock(3)

pthread_mutex_unlock(3)

pthread_mutex_init(3)

NAME

pthread_mutex_init - Creates a mutex

SYNOPSIS

#include <pthread.h> int pthread_mutex_init( pthread_mutex_t *mutex, pthread_mutexattr_t attr);

PARAMETERS

mutexMutex that is created. 

attrAttributes object that defines the characteristics of the created mutex.  If you specify pthread_mutexattr_default, default attributes are used. 

DESCRIPTION

The pthread_mutex_init() routine creates a mutex and initializes it to the unlocked state. If the thread that called this routine terminates, the created mutex is not automatically deallocated, because it is considered shared among multiple threads.

RETURN VALUES

If an error condition occurs, this routine returns −1, the mutex is not initialized, the contents of mutex are undefined, and errno may be set to one of the following values:

Return Error Description
0 Successful completion.
\-1 [EAGAIN] The system lacks the necessary resources to initialize another mutex. 
\-1 [EINVAL] The value specified by attr is invalid.
\-1 [ENOMEM] Insufficient memory exists to initialize the mutex.

RELATED INFORMATION

Functions:  pthread_mutexattr_create(3), pthread_mutexattr_getkind_np(3), pthread_mutexattr_setkind_np(3), pthread_mutex_lock(3), pthread_mutex_trylock(3), pthread_mutex_unlock(3). 

Hewlett-Packard Company  —  OSF DCE 1.1/HP DCE 1.5

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026