pthread_mutex_init(&(sem->mtx), NULL);
for (i = 0; i < SXE_MSEMAPH_MAX_CONDITIONS; i++)
pthread_cond_init(&(sem->cnd[i]), NULL);
pthread_mutex_init(&(sem->mtx), NULL);
for (i = 0; i < SXE_MSEMAPH_MAX_CONDITIONS; i++)
pthread_cond_init(&(sem->cnd[i]), NULL);