title: C# wait for all threads to finish in Main()
body: <p>I've been coding a Multithreading Application to solve mazes. I start a new thread from my <code>Program Class</code>, <code>Main()</code> method, to begin solving the maze. He will then call a static method to create a new thread if he finds a bifurcation. How can I wait for all the threads running in the background to finish, in order to, for example display a message of completion?</p>
  
  <p>This is an eskeleton of what I'm trying to do:</p>
  
  <pre><code>var explorer = new Explorer(/*Some arguments*/);
  var thread = new Thread(explorer.Explore) {Name = "Thread 0"};
  thread.Start();
  
  //Thread_0_and_Threads_he_generates_through_static_class.Join()    
  
  Console.WriteLine("I'm done bro.");
  Console.ReadKey();
  </code></pre>
  
  <p>Is there a way to do this? Honestly, first time working with Multithreading in this way, so I apologize for the poor code. Any other information I'll be more than happy to provide. Thanks in advance.</p>