set_lock and doc