lock the control for multi thread