Initialize a mutex
int mtx_init(mtx_t mtx, int type) { mtx.locked = false; mtx.type = type; return thrd_success; }