title: how to set the priority to get the mutex in C/c++
body: <p>I have 3 process (equal priority)</p>
  
  <ol>
  <li>P1</li>
  <li>P2</li>
  <li>P3(timer)</li>
  </ol>
  
  <p>priority to get the mutex is as follows: <code>P1(1 priority), P2(2 priority), P3(timer)(3 priority)</code></p>
  
  <p>If suppose <code>p3</code> comes and get the mutex
  then <code>p2</code> comes and wait for mutex
  after that p1 comes and it  also wait for mutex</p>
  
  <p>if <code>p3</code> release mutex then <code>p1</code> should get the mutex not <code>p2</code>.</p>
  
  <p>How to perform this in C or C++.</p>
  
  <p>Note : all processes are running inside threads having same priority.</p>
  
  <p>OS - windows Xp</p>