title: Why do we need boost::thread_specific_ptr?
body: <p>Why do we need boost::thread_specific_ptr, or in other words what can we not easily do without it? </p>
  
  <p>I can see why pthread provides pthread_getspecific() etc. These functions are useful for cleaning up after dead threads, and handy to call from C-style functions (the obvious alternative being to pass a pointer everywhere that points to some memory allocated before the thread was created).</p>
  
  <p>In contrast, the constructor of boost:thread takes a callable class by value, and everything non-static in that class becomes thread local once it is copied. I cannot see why I would want to use boost::thread_specific_ptr in preference to a class member any more than I would want to use a global variable in OOP code.</p>
  
  <p>Do I horribly misunderstand anything? A very brief example would help, please. Many thanks.</p>