title: C++ Runnable class
body: <p>I'd like to achieve something similar to interface Runnable from Java. I try to do that in that way:</p>
  
  <pre><code>class Runnable{
      public:
          void start(){
              t = std::thread(&amp;Runnable::run, this);
          }
      protected:
          virtual void run(){
          }
  };
  </code></pre>
  
  <p>Idea is simple. I'd like to overload run method and then start() should launch overloaded one. But... it doesn't work.</p>
  
  <pre><code>terminate called after throwing an instance of 'std::system_error'
    what():  Operation not permitted
  </code></pre>
  
  <p>PS I load an instance of class, which derives from Runnable, from dynamic library with dlopen.</p>