Section 15. The surviving husband or wife of a deceased person, except as provided in section thirty-six of chapter two hundred and nine, within six months after the probate of the will of such deceased, may file in the registry of probate a writing signed by him or by her, waiving any provisions that may have been made in it for him or for her, or claiming such portion of the estate of the deceased as he or she is given the right to claim under this section, and if the deceased left issue, he or she shall thereupon take one third of the personal and one third of the real property; and if the deceased left kindred but no issue, he or she shall take twenty-five thousand dollars and one half of the remaining personal and one half of the remaining real property; except that in either case if he or she would thus take real and personal property to an amount exceeding twenty-five thousand dollars in value, he or she shall receive, in addition to that amount, only the income during his or her life of the excess of his or her share of such estate above that amount, the personal property to be held in trust and the real property vested in him or her for life, from the death of the deceased. If the deceased left no issue or kindred, the surviving husband or wife shall take twenty-five thousand dollars and one half of the remaining personal and one half of the remaining real property absolutely. If the real and personal property of the deceased which the surviving husband or wife takes under the foregoing provisions exceeds twenty-five thousand dollars in value, and the surviving husband or wife is to take only twenty-five thousand dollars absolutely, the twenty-five thousand dollars, above given absolutely shall be paid out of that part of the personal property in which the husband or wife is interested; and if such part is insufficient the deficiency shall, upon the petition of any person interested, be paid from the sale or mortgage in fee, in the manner provided for the payment of debts or legacies, of that part of the real property in which he or she is interested. Such sale or mortgage may be made either before or after such part is set off from the other real property of the deceased for the life of the husband or widow. If, after probate of such will, legal proceedings have been instituted wherein its validity or effect is drawn in question, the probate court may, within said six months, on petition and after such notice as it orders, extend the time for filing the aforesaid claim and waiver until the expiration of six months from the termination of such proceedings.