Threshold effects in nuclear reactions and the line shape of resonances