Implemented 2 locks in the same program