/* Release a Mutex that was obtained by osMutexWait.  */
osStatus_t osMutexRelease(osMutexId_t mutex_id)
/* Release a Mutex that was obtained by osMutexWait.  */
osStatus_t osMutexRelease(osMutexId_t mutex_id)
{
	struct cv2_mutex *mutex = (struct cv2_mutex *) mutex_id;
	if (mutex_id == NULL) {
		return osErrorParameter;
	}
	if (k_is_in_isr()) {
		return osErrorISR;
	}
	if (k_mutex_unlock(&mutex->z_mutex) != 0) {
		return osErrorResource;
	}
	return osOK;
}