early implementation of mutex