Multithreaded Programming Guide

Destroying the Condition Variable State

Use pthread_cond_destroy(3C) to destroy any state that is associated with the condition variable pointed to by cv.

pthread_cond_destroy Syntax

int pthread_cond_destroy(pthread_cond_t *cv);
#include <pthread.h>

pthread_cond_t cv;
int ret;

/* Condition variable is destroyed */
ret = pthread_cond_destroy(&cv); 

Note that the space for storing the condition variable is not freed.

pthread_cond_destroy Return Values

pthread_cond_destroy() returns zero after completing successfully. Any other return value indicates that an error occurred. When the following condition occurs, the function fails and returns the corresponding value.



The value specified by cv is invalid.