implemented primitive locks