Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/135.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
同时运行javascript函数和firebreath函数_Javascript_C++_Asynchronous_Firebreath - Fatal编程技术网

同时运行javascript函数和firebreath函数

同时运行javascript函数和firebreath函数,javascript,c++,asynchronous,firebreath,Javascript,C++,Asynchronous,Firebreath,我试图同时运行javascript函数和firebreath函数 为此,我创建了一个这样的线程,在这里我调用了一个函数,使用相同的数据/值应该同时运行javascript和plugin函数,其中第三个参数是我希望运行函数的迭代次数 tobiiThread = boost::thread(boost::bind(&TobiiWrapper::drawCalibration, this, 5)); tobiiThread.join(); 这两个函数似乎都被激发,但javascript函数似

我试图同时运行javascript函数和firebreath函数 为此,我创建了一个这样的线程,在这里我调用了一个函数,使用相同的数据/值应该同时运行javascript和plugin函数,其中第三个参数是我希望运行函数的迭代次数

tobiiThread = boost::thread(boost::bind(&TobiiWrapper::drawCalibration, this, 5));
tobiiThread.join();
这两个函数似乎都被激发,但javascript函数似乎是在等待迭代中的所有其他调用之后激发的。我试图消除睡眠,但没有改变任何事情

bool TobiiWrapper::drawCalibration(int argNr) {
  Point2d point(0.0,0.0);
  for(int i = 1; i-1 < argNr; i++) {
     _parent->fire_calibration(point.x, point.y);
     boost::this_thread::sleep(boost::posix_time::milliseconds(500));
     _tracker->addCalibrationPoint(point);
     boost::this_thread::sleep(boost::posix_time::milliseconds(3000));
  }
return true;
}
如何通过在TobiiWrapper类中操作/编码使函数同时启动?

在查看之后,我可能只需要知道如何在类中使用JSObjectPtr/回调,以便在线程中使用回调参数
    FB_JSAPI_EVENT(calibration, 2, (const double, const double));