Initializes a mutex.
tis_mutex_init( mutex );
Argument Data Type Accessmutex opaque pthread_mutex_t write
#includeint tis_mutex_init ( pthread_mutex_t *mutex );
The mutex is initialized and set to the unlocked state. Mutexes can be allocated in heap or static memory, but not on a stack.
The PTHREAD_MUTEX_INITIALIZER macro can be used to statically initialize a mutex without calling this routine. Statically initialized mutexes need not be destroyed using tis_mutex_destroy. Use this macro as follows: pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
Return Description0 Successful completion. [EAGAIN] The system lacks the necessary resources to initialize a mutex. [ENOMEM] Insufficient memory exists to initialize the mutex. [EBUSY] The implementation has detected an attempt to reinitialize the mutex (a previously initialized, but not yet destroyed mutex). [EINVAL] The value specified by mutex is invalid. [EPERM] The caller does not have privileges to perform this operation.
tis_mutex_lock tis_mutex_trylock tis_mutex_unlock tis_mutex_destroy