Put mutex and sem on struct instead of pointers