[PATCH 1/7] util: add lock/unlock function