Saute the shallots in a saucepan over medium heat with olive oil, thyme, garlic, cook and cook 3-4 minutes until they begin to be soft. Add the sugar and raise the heat to the maximum. Stir and cook a few more minutes until the shallots are slightly caramelized. Add the mushrooms and butter. Saute a couple of minutes until they begin to take color, pour the sherry vinegar and rectify the seasoning. Let the liquid evaporate for one or two minutes. Remove the garlic. Add the chopped parsley.