add lock.cpp