A limited partner may withdraw from a limited partnership at the time or upon the happening of events specified in writing in the partnership agreement. If the agreement does not specify in writing the time or the events upon the happening of which a limited partner may withdraw or a definite time for the dissolution and winding up of the limited partnership, a limited partner may withdraw upon not less than six months' prior written notice to each general partner at his address on the books of the limited partnership at its office in this state.