Heat the olive oil in a pan and add the onions and garlic. Season, cover with a lid and cook on a low heat for 15 minutes. Add the vinegar and sugar and cook for a further 5 minutes.
Melt the butter in a frying pan and fry the mushrooms, Season, add the thyme and cook for 3-4 minutes. Add a squeeze of lemon juice.