title: Using semaphore in C#
body: <p>Hi I am trying to use <code>Semaphore</code> in my application. I have declared like this.</p>
  <pre><code>class MyThread
  {
      public Thread Thrd;
  
      static Semaphore sem = new Semaphore(2, 2);
      public MyThread(string name)
      {
          Thrd = new Thread(this.Run);
          Thrd.Name = name;
          Thrd.Start();
      }
  }
  </code></pre>
  <p>But I am not able to compile It's giving me this error:</p>
  <pre><code>The type or namespace name 'Semaphore' could not be found 
  (are you missing a using directive or an assembly reference?)
  </code></pre>
  <p>But I have already added the namespace  <code>using System.Threading;</code> I am able to using <strong>Mutex</strong>.
  May be what was I am missing. There is any other reference need to add.? I am using <strong>VS 2010</strong>. Framework 4.0</p>