title: Using cvQueryFrame and boost::thread together
body: <p>I need to call <code>cvQueryFrame</code> (to capture a frame from a webcam with opencv) instead a thread created with boost. Here is a little example code:</p>
  
  <pre><code>void testCVfunc(){
      IplImage* frame;
      CvCapture *capture;
      capture = cvCreateCameraCapture(CV_CAP_ANY);
      if(!capture){
          exit(1);
      }
      frame = cvQueryFrame(capture);
      cvNamedWindow("testCV", 1);
  
      while(frame = cvQueryFrame(capture)){
          if(!frame){
              exit(2);
          }
          cvShowImage("testCV", frame);
          cvWaitKey(1);
      }
      cvReleaseImage(&amp;frame);
      cvReleaseCapture(&amp;capture);
  }
  
  int main(){
      //Method 1: without boost::thread, works fine
      testCVfunc();
  
      //Method 2: with boost::thread, show black screen
      char entree;
      boost::thread threadTestCV = boost::thread(&amp;testCVfunc);
      std::cin &gt;&gt; entree;
  }
  </code></pre>
  
  <p>As the comments say, <code>testCVfunc</code> does its job if I don't call it from a <code>boost::thread</code>, but I get a black screen if I use <code>boost::thread</code>.
  I don't get the problem, maybe someone does?</p>
  
  <p>Thank you for your help.</p>