The sem_terminate function deallocates the semaphore specified by id. You can use this function to deallocate a semaphore that was previously allocated with the function sem_init.
#include <base/sem.h> void sem_terminate(SEMAPHORE id);
void
SEMAPHORE id is the unique identification number of the semaphore.