Adding more lock stuff whenever processes are dealt with