title: Running javascript function and firebreath function simultaneously
body: <p>I'm trying to run javascript function and firebreath function simultaneously
  to do so i created a thread like this, where i call a function that using the same data/value should run both the javascript and plugin function, where the 3rd argument is number of iterations I want to run the functions. </p>
  
  <pre><code>tobiiThread = boost::thread(boost::bind(&amp;TobiiWrapper::drawCalibration, this, 5));
  tobiiThread.join();
  </code></pre>
  
  <p>The functions seems to be fire both functions but the javascript function seems to be fired after waiting for all other calls in the iterations. I've tried to remove sleep but didn't change anything.</p>
  
  <pre><code>bool TobiiWrapper::drawCalibration(int argNr) {
    Point2d point(0.0,0.0);
    for(int i = 1; i-1 &lt; argNr; i++) {
       _parent-&gt;fire_calibration(point.x, point.y);
       boost::this_thread::sleep(boost::posix_time::milliseconds(500));
       _tracker-&gt;addCalibrationPoint(point);
       boost::this_thread::sleep(boost::posix_time::milliseconds(3000));
    }
  return true;
  }
  </code></pre>
  
  <p>my JS eventcode:</p>
  
  <pre><code>    FB_JSAPI_EVENT(calibration, 2, (const double, const double));
  </code></pre>
  
  <p>How can I make the function fire simultaneously, by only operating/coding within my (TobiiWrapper) class?</p>