title: InterviewQ: How do you code a mutex?
body: <p>I'm unfortunately out of a job and have been interviewing around lately. I faced this same question twice now, and was lost both times I was asked this question. </p>
  
  <blockquote>
    <p>"How do you code a mutex"?</p>
  </blockquote>
  
  <p>Conceptually I understand a mutex locks a certain part of code so multiple threads can not enter the critical section at the same time, eliminating data races. The first time I was asked to conceptually describe how I would code it, the second time I was asked to code it. I've been googling and haven't found any answers... can anyone help?</p>
  
  <p>Thanks.</p>