HELPLIB.HLB  —  DCE  DCE_THREADS, Application Routines, pthread_mutex_init
 NAME

    pthread_mutex_init - Creates a mutex

 SYNOPSIS

     #include <pthread.h>

     int pthread_mutex_init( pthread_mutex_t     *mutex,
                              pthread_mutexattr_t attr );

 PARAMETERS

     mutex                Mutex that is created.

     attr                 Attributes 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 con-
 sidered 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      [ENOMEM]    Insufficient memory exists to initialize the
                        mutex.

 RELATED INFORMATION

     FUNCTIONS:  pthread_mutexattr_create
                 pthread_mutexattr_getkind_np
                 pthread_mutexattr_setkind_np
                 pthread_mutex_lock
                 pthread_mutex_trylock
                 pthread_mutex_unlock
Close Help