mutex_destroy(3synch)


mutex_destroy -- destroy a mutex

Synopsis

   cc [options] -Kthread file
   

#include <synch.h>

int mutex_destroy(mutex_t *mutex);

Description

mutex_destroy destroys the mutex pointed to by mutex. This includes invalidating the mutex and freeing any associated implementation-allocated dynamic resources.

Any user-allocated dynamic storage is unaffected by mutex_destroy and must be explicitly released by the program.

Parameters


mutex
pointer to mutex to be destroyed

Return values

mutex_destroy returns zero for success and an error number for failure.

Errors

If any of the following conditions is detected, mutex_destroy returns the corresponding value:

EBUSY
mutex locked or another thread waiting to acquire mutex

EINVAL
invalid argument specified

EINVAL
the mutex denoted by mutex already destroyed

References

Intro(3synch), mutex(3synch), mutex_init(3synch), mutex_lock(3synch), mutex_trylock(3synch), mutex_unlock(3synch)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004