A limited partner may withdraw from a limited partnership at the time or upon the happening of events specified in the partnership agreement and in accordance with the partnership agreement. A partnership agreement may provide that a limited partner may not withdraw from a limited partnership or assign a partnership interest in a limited partnership prior to the dissolution and winding up of the limited partnership. If the partnership agreement does not specify the time or the events upon the happening of which a limited partner may or may not 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 or her address as set forth in the certificate of limited partnership filed in the office of the Secretary of State.