Multithreaded Programming Guide

Destroy the Semaphore State

sem_destroy(3THR)

#include <thread.h>

int sema_destroy(sema_t *sp);

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