mutex and gate implementations - synchronized first version
starting tests