split lock.h to lock.cpp