Rate This Document
Findability
Accuracy
Completeness
Readability

HTL_thread_mutexattr_init

Initializes mutex attributes.

Interface Definition

int HTL_thread_mutexattr_init(HTL_thread_mutexattr_t *thread_mutexattr);

Description

HTL_thread_mutexattr_init() is used to initialize the mutex attribute and return the mutex handle through thread_mutexattr.

By default, the mutex attribute is non-recursive.

thread_mutexattr must be destroyed by HTL_thread_mutexattr_destroy() after being used.

Parameters

Parameter

Type

Description

Input/Output

thread_mutexattr

HTL_thread_mutexattr_t *

Address of the handle to the mutex attribute.

Output

Return Value

  • HTL_THREAD_SUCCESS: success.
  • Other values: failure. For details, see the error code descriptions.

Example

    HTL_thread_mutexattr_t mutex_attr;
    int ret = HTL_thread_mutexattr_init(&mutex_attr);
    if ( ret != HTL_THREAD_SUCCESS) return;