title: Passing arguments to _beginthread within class function
body: <p>I've been using _beginthread within my (windows) C++ class to create threads.  As I have learned, to use _beginthread and pass a member function within a class, there is a rather obtuse wrapping protocol that has to be followed, for example:</p>
  
  <pre><code>class MyClass
  {
  public:
      void fun_1()
      {  
          _beginthread(&amp;MyClass::fun_2_wrapper, 0, static_cast&lt;void*&gt;(this));
      }
  
  private:
      void fun_2()
      {
          printf("hello");  
      }  
  
      static void __cdecl fun_2_wrapper(void* o)
      {
          static_cast&lt;MyClass*&gt;(o)-&gt;fun_2();
      }
  };
  </code></pre>
  
  <p>I have been having trouble translating this model to one that accepts arguments for my thread function.  For instance, if I wanted my thread function to instead be:</p>
  
  <pre><code>void fun_2(int a)
  </code></pre>
  
  <p>How would I properly adapt my function calls?  (Note, I am trying to accomplish this without boost::thread or similar libraries for project consistency)</p>