title: C# Threading: Using Monitor.Wait, Lock and PulseAll
body: <p>I am new to CSharp and Threading.</p>
  
  <p>To be familiar with Monitor.Wait,Monitor.lock and Monitor.PulseAll,I framed a scenario described below.</p>
  
  <p><i>
  "A FootballGround is being shared by different teams for practicing purpose. At any  time only one team can use the ground for their practice. A team can use the ground for 30 minutes for their practice. Once the time reaches 25 minutes it should signal other threads that the ground is about to free after 5 minutes.When  the ground is wet (enum has three values free,allotted,wet) no team is allowed to lock the ground and all should wait for 10 minutes”
  </i></p>
  
  <p>Honestly speaking, I do not know how turn the description in to actual coding. Based on my understanding I designed the outline.</p>
  
  <pre><code>namespace ThreadingSimulation
   {
  
    // A Random Activity can be picked up from this enum by a team
  
           public enum RandomGroundStatus
           {
               free,
               allotted,
               Wet          
           }
  
  class FootBallGround
  {
  
      public void Playing(object obj)
      {
        // Here the name of the team which is using the  ground will be printed
        // Once the time is reached to 25 minnutes the active thread acquired
        // the lock will signal  other threads    
  
      }
  
     public void GroundCleaningInProgress(object obj)
     {
  
        // Ground cleaning is in progress all of you
        // wait for 10 minutes
  
     }
  
  }    
  
  
  
  
   class Team
     {
       string teamName;  
  
        static void Main()
        {
  
          //select random value for GrandStatus from enum
  
         // if the ground is wet no team is allowed to get the
         // ground for 10 minutes  
  
          //if the ground is free "Team A" locks the ground
  
          // otherwise "Team B" locks the ground
  
        }
  
     }
  
  }
  </code></pre>
  
  <p>Here I do not know how to apply locks and signalls.kindly help  me .</p>