Fix for a potential data race condition

This commit is contained in:
rajithr 2015-05-26 11:31:31 +05:30
parent 2952c10ced
commit ff6881efbf

View File

@ -284,7 +284,9 @@ void* cv::workcycleObjectDetectorFunction(void* p)
{
CATCH_ALL_AND_LOG({ ((cv::DetectionBasedTracker::SeparateDetectionWork*)p)->workcycleObjectDetector(); });
try{
((cv::DetectionBasedTracker::SeparateDetectionWork*)p)->lock();
((cv::DetectionBasedTracker::SeparateDetectionWork*)p)->stateThread = cv::DetectionBasedTracker::SeparateDetectionWork::STATE_THREAD_STOPPED;
((cv::DetectionBasedTracker::SeparateDetectionWork*)p)->unlock();
} catch(...) {
LOGE0("DetectionBasedTracker: workcycleObjectDetectorFunction: ERROR concerning pointer, received as the function parameter");
}