/* Delete a semaphore that was created by osSemaphoreCreate.  */
osStatus osSemaphoreDelete(osSemaphoreId semaphore_id)
/* Delete a semaphore that was created by osSemaphoreCreate.  */
osStatus osSemaphoreDelete(osSemaphoreId semaphore_id)
{
	struct k_sem *semaphore = (struct k_sem *) semaphore_id;
	if (semaphore_id == NULL) {
		return osErrorParameter;
	}
	if (k_is_in_isr()) {
		return osErrorISR;
	}
	k_mem_slab_free(&cmsis_semaphore_slab, (void *)semaphore);
	return osOK;
}