A general theorem on the convergence of operator semigroups