Heat the oil in a pot over medium heat. Add the onions, garlic and mushrooms and cook until tender, about 5 minutes. Add the rice and thyme and mix well. Pour in the stock and bring to a boil. When boiling, cover the rice, turn the heat to its lowest setting, and cook for 30 to 35 minutes, or until the rice is tender. Mix in green onions, salt and pepper and serve.