title: How can I use boost::thread::timed_join with nanoseconds enabled in boost::date_time?
body: <p>Here is some C++ code illustrating my problem with a minimal expample:</p>
  
  <pre><code>// uncomment the next line, to make it hang up:
  //#define BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG //needed for nanosecond support of boost
  #include &lt;boost/thread.hpp&gt;
  void foo()
  {
      while(true);
  }
  int main(int noParameters, char **parameterArray)
  {
      boost::thread MyThread(&amp;foo);
      if ( MyThread.timed_join( boost::posix_time::seconds(1) ) )
      {
          std::cout&lt;&lt;"\nDone!\n";
      }
      else
      {
          std::cerr&lt;&lt;"\nTimed out!\n";
      }
  }
  </code></pre>
  
  <p>As long as I don't turn on the nanosecond support everthing works as expected, but as soon as I uncomment the #define needed for the nanosecond support in boost::posix_time the program doesn't get past the if-statement any more, just as if I had called join() instead of timed_join().</p>
  
  <p>Now I've already figured out, that this happens because BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG changes the actual data representation of the timestamps from a single 64bit integer to 64+32 bit. A lot boost stuff is completely implemented inside the headers but the thread methods are not and because of that they cannot adapt to the new data format without compiling them again with the apropriate options. Since the code is meant to run on an external server, compiling my own version of boost is not an option and neither is turning off the nanosecond support.</p>
  
  <p>Therefore my question is as follows: Is there a way to pass on a value (on the order of seconds) to timed_join() without using the incompatible 96bit posix_time methods and without modifying the standard boost packages?</p>
  
  <p>I'm running on Ubuntu 12.04 with boost 1.46.1.</p>