process in_progress complete task
added more common lock/unlock functions