pipe_lock_unlock function

Lock steps