Destroy a forksafe mutex
Synopsis:
#include <forksafe_mutex.h>
int forksafe_mutex_destroy( forksafe_mutex_t* mutex );
Arguments:
- mutex
- A pointer to the forksafe_mutex_t object that you want to destroy.
Library:
libc, libforksafe_mutex
In QNX Neutrino 7.1 or later, there are two versions of the forksafe_mutex_*() functions:
- The functions in libc are declared as weak symbols and use a regular mutex,
simply calling the corresponding pthread_mutex_*() functions.
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
- The functions in libforksafe_mutex use a forksafe mutex.
Use the -l forksafe_mutex option to
qcc
to link against this library.
Description:
The forksafe_mutex_destroy() function destroys the unlocked forksafe mutex
mutex.
You can destroy a locked mutex only if you're the owner of that mutex.
Note:
Once you've destroyed a mutex, don't reuse it without reinitializing it by
calling
forksafe_mutex_init().
For more information about forksafe mutexes, see
Using fork() in a multithreaded process
in the Processes and Threads chapter of Getting Started with QNX Neutrino.
Returns:
- EOK
- Success.
- EBUSY
- The mutex is locked by another thread.
- EINVAL
- Invalid mutex mutex.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |