Thermodynamic consideration of the sol-gel transition in polymer solutions