implement locks, CVs, catmouse problem