title: Significance of -pthread flag when compiling
body: <p>In various multi threaded C and C++ projects I've seen the <code>-pthread</code> flag applied to both the compiling and linking stage while others don't use it at all and just pass <code>-lpthread</code> to the linking stage.</p>
  
  <p>Is there any danger not compiling and linking with the <code>-pthread</code> flag - i.e. what does <code>-pthread</code> actually do ? I'm primarily interested in Linux platforms.</p>