Multithreaded Programming Guide

Destroy the Semaphore State

sema_destroy(3T)

#include <thread.h>

int sema_destroy(sema_t *sp);

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