title: Pantheios and boost::thread
body: <p>I am having some trouble using the pantheios logging library with boost::threads. It seems that if I use any pantheios logging before creating the thread, I will get a segfault.</p>
  
  <p>For example, the following would work:</p>
  
  <pre><code>thread_ = new boost::thread(&amp;foo);
  pantheios::log(pantheios::debug, "Hello world");
  </code></pre>
  
  <p>But if the order of the statements are switched, a stack trace reveals that I crash on <code>start_thread</code> in boost.</p>
  
  <pre><code>pantheios::log(pantheios::debug, "Hello world");
  thread_ = new boost::thread(&amp;foo);
  // SEGFAULT!
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>EDIT: More context</p>
  
  <pre><code>int main()
  {
      pantheios::log(...);
      MyClass myClass(/* some arguments, which are all literals */);
  
      // Do some more work
  
      return 0;
  }
  
  // MyClass constructor
  MyClass::MyClass(/* args */)
      : member1_(arg1)
      , member2_(arg2)
  {
      thread_ = new boost::thread(&amp;MyClass::workerLoop, this);
  }
  
  // Destructor
  MyClass::~MyClass()
  {
      thread_-&gt;join();
      delete thread_;
  }
  </code></pre>
  
  <p>This will segfault at <code>start_thread</code>. Once again if I swap the two lines in <code>main</code> it will work without any problems.</p>