Add basic peterson lock algorithm