title: How can I code a monitor in C?
body: <p>I need to do some process synchronization in C. I want to use a monitor, and I have read a lot about them. However I have been unable to find out how to implement one in C. I have seen them done in Java and other languages like C++, but I am unable to find examples in C. </p>
  
  <p>I have looked through K&amp;R and there is no example in there. I skimmed through Unix Systems Programming, Communication, Concurrency and Threads, but was unable to find a monitor implementation in there. </p>
  
  <p>This brings me here. Where and how do I define a monitor? How do I implement it within the rest of the code? </p>
  
  <p>/* I am coding in a *nix environment */</p>