After being an early supporter of the EEC, Thatcher was turning away from the EEC/EU by the late 80's, which did for her. politically. She was a Brexiteer long before 2016.
Cameron would have known all that but trapped himself into the referendum possibility anyway. Well done DC.