Threshold condition for non-linear tearing modes in tokamaks