Saute onion, celery and carrots in butter for 5 minutes. Add mushrooms and saute for 3 minutes. Sprinkle in flour, stir well and saute for 1 minute. Add stock and thyme. Cover and simmer for 15 minutes. Add sherry and rice. Simmer for 1 minute. Season with salt and pepper and serve.