1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

fixed use of std::lock outside of ifdefs

This commit is contained in:
E Sommerlade
2016-10-26 15:37:06 +01:00
parent 118c1b4ace
commit d0474a9b81
@@ -139,13 +139,24 @@ class cv::DetectionBasedTracker::SeparateDetectionWork
}
void setParameters(const cv::DetectionBasedTracker::Parameters& params)
{
#ifdef USE_STD_THREADS
std::unique_lock<std::mutex> mtx_lock(mtx);
#else
pthread_mutex_lock(&mutex);
#endif
parameters = params;
#ifndef USE_STD_THREADS
pthread_mutex_unlock(&mutex);
#endif
}
inline void init()
{
#ifdef USE_STD_THREADS
std::unique_lock<std::mutex> mtx_lock(mtx);
#else
pthread_mutex_lock(&mutex);
#endif
stateThread = STATE_THREAD_STOPPED;
isObjectDetectingReady = false;
shouldObjectDetectingResultsBeForgot = false;
@@ -153,6 +164,7 @@ class cv::DetectionBasedTracker::SeparateDetectionWork
objectDetectorThreadStartStop.notify_one();
#else
pthread_cond_signal(&(objectDetectorThreadStartStop));
pthread_mutex_unlock(&mutex);
#endif
}
protected: