1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-19 19:44:14 +08:00

Thread-safe vector insertion while using OpenMP

This commit is contained in:
Hamdi Sahloul
2017-03-09 18:23:14 +09:00
parent 53e34260b1
commit 2c089f60ff

View File

@@ -645,7 +645,12 @@ void PPF3DDetector::match(const Mat& pc, std::vector<Pose3DPtr>& results, const
Pose3DPtr pose(new Pose3D(alpha, refIndMax, maxVotes));
pose->updatePose(rawPose);
poseList.push_back(pose);
#if defined (_OPENMP)
#pragma omp critical
#endif
{
poseList.push_back(pose);
}
#if defined (_OPENMP)
free(accumulator);