4 tablespoons unsalted butter
2 pounds yellow onions, sliced 1/4-inch into half circles
1 teaspoon sugar
1 tablespoons all-purpose flour
1/2 cup dry sherry
3 cups Homemade Beef Stock for French Onion Soup
2 teaspoons chopped fresh thyme or 3/4 teaspoon dried thyme
Salt and freshly ground black pepper
1 small French baguette, sliced crosswise into 1/2-inch pieces
8 ounces Gruyere cheese, grated on the large holes of a box grater (about 3 cups)
Melt butter in a large Dutch oven or heavy pot on medium-low heat. Add onions. Spread them out in as thin a layer as possible. Sprinkle with sugar, and cook, stirring just as needed to keep onions from sticking, until they are melting and soft, golden brown, and beginning to caramelize, about 1 hour.
Sprinkle flour over onions, and stir to coat. Add sherry, stock, and thyme, and bring to a simmer. Cook, partially covered, for about 30 minutes, to allow the flavors to combine. Season with salt and pepper to taste.
Meanwhile, lightly toast bread under a broiler; set aside. Ladle hot soup into six ovenproof bowls. Arrange the bowls on a baking pan. Place 1 or 2 slices of toasted bread over each bowl of soup. Sprinkle 1/2 cup grated cheese over bread in each bowl, and place under the broiler until cheese is melted and crusty brown around the edges. Watch carefully that bread doesn't burn. Serve immediately.