DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

mutex_destroy(SYNCH)


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(SYNCH), mutex(SYNCH), mutex_init(SYNCH), mutex_lock(SYNCH), mutex_trylock(SYNCH), mutex_unlock(SYNCH)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005