title: Can I lock and unlock a fifo (named pipe) in C?
body: <p>I have two progress, <code>p1</code> and <code>p2</code>, and a named pipe <code>var</code> for ipc between 2 progress.<br>
  I want to lock <code>var</code>'s rw for <code>p2</code> when <code>p1</code> writes, and unlock <code>var</code> when <code>p1</code> finished write.<br></p>
  
  <p>ps:</p>
  
  <p>I using select for nonblocking, so <code>p2</code> will get readable when <code>p1</code> put anything to <code>var</code>.Can I let <code>var</code> become readable when <code>p1</code> finish write?</p>