Revert "mutex made into class"

This reverts commit d51ba1c67f98e9ea777d0e9b0c4543a28ff8b2ac.
Revert "Revert "mutex made into class""

This reverts commit 846426b50cc49afc3518d829fea7214f24196640.