Updated: October 28, 2024 |
Destroy a mutex
#include <threads.h> void mtx_destroy( mtx_t* mutex );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The mtx_destroy() function destroys the unlocked mutex mutex. You can destroy a locked mutex only if you're its owner. An invalid input mutex or an attempt to destroy a mutex locked by another thread results in an unsuccessful mtx_destroy() call.
The mtx_destroy() function calls the pthread_mutex_destroy() function. Any return from this function gets casted to a void pointer in mtx_destroy(). You cannot use the C11 functions interchangeably with the pthread mutex functions.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |