Added implementation of shared mutex and lock