add lock to avoid gyslogin and cgslogin for the same time