/* Delete a semaphore that was created by osSemaphoreCreate.  */
osStatus_t osSemaphoreDelete(osSemaphoreId_t semaphore_id)
/* Delete a semaphore that was created by osSemaphoreCreate.  */
osStatus_t osSemaphoreDelete(osSemaphoreId_t semaphore_id)
{
	struct cv2_sem *semaphore = (struct cv2_sem *)semaphore_id;
	if (semaphore_id == NULL) {
		return osErrorParameter;
	}
	if (k_is_in_isr()) {
		return osErrorISR;
	}
	k_mem_slab_free(&cv2_semaphore_slab, (void *)semaphore);
	return osOK;
}