Put mutex and cond on struct instead of pointers