Multithreaded Programming Guide

Destroy the Semaphore State

sem_destroy(3RT)

#include <thread.h>

int sema_destroy(sema_t *sp);

Use sem_destroy(3RT) to destroy any state associated with the semaphore pointed to by sp. The space for storing the semaphore is not freed.