Invalidation of synchronization mechanisms
The syntax of the functions that invalidate synchronization structures
is even more regular than that of the initializing functions.
The first and only argument is a pointer to the mechanism-specific structure
to be invalidated.
The syntax is:
int sema_destroy( sema_t *sema);
int _spin_destroy( spin_t *lock);
int barrier_destroy( barrier_t *barrier);
int _barrier_spin_destroy(barrier_spin_t *barrier);
int cond_destroy( cond_t *cond);
int mutex_destroy( mutex_t *mutex);
int rmutex_destroy( rmutex_t *rmutex);
int rwlock_destroy( rwlock_t *rwlock);
Each function can fail as follows:
The effect of these functions is:
Invalid argument specified.
Mechanism currently in use.
To mark the structure as being invalid for further use
To allow the recovery of any Threads Library internal
resources that may have been allocated when the synchronization mechanism
Though these _destroy functions recover underlying resources,
the space for the synchronization structure itself remains.
If the space is to be recovered
(say the structure will no longer be used)
that must be done separately.
a space acquired from
should be recovered with free
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004