Skip to content

Commit

Permalink
Replaced WITH_PTHREADS with HAS_MULTITHREADING in source
Browse files Browse the repository at this point in the history
  • Loading branch information
ayberkozgur committed Nov 25, 2014
1 parent 4d17eb6 commit c21a9fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif()
##########################################

if(WITH_PTHREADS)
add_definitions(-DWITH_PTHREADS)
add_definitions(-DHAS_MULTITHREADING)
endif()

if(${OpenCV_VERSION} VERSION_GREATER 2.9.0)
Expand Down
4 changes: 2 additions & 2 deletions include/chilitags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ enum DetectionTrigger {
*/
DETECT_PERIODICALLY,

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
/**
* @brief Runs the detection in the background, with a period
*
Expand Down Expand Up @@ -204,7 +204,7 @@ TagCornerMap find(
*/
void setDetectionPeriod(int period);

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
/**
* @brief Gets the latest idle time in case of asynchronous detection
*
Expand Down
6 changes: 3 additions & 3 deletions src/Chilitags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void setDetectionPeriod(int period) {
mCallsBeforeDetection = period;
}

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
float getLatestAsyncDetectionIdleMillis(){
return mDetect.getLatestAsyncIdleMillis();
}
Expand Down Expand Up @@ -165,7 +165,7 @@ TagCornerMap find(
return scaleBy(mFilter(tags), scaleFactor);
}

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
case ASYNC_DETECT_PERIODICALLY:
mDetect.launchBackgroundThread(mTrack);
mCallsBeforeNextDetection--;
Expand Down Expand Up @@ -277,7 +277,7 @@ void Chilitags::setMinInputWidth(int minWidth) {
mImpl->setMinInputWidth(minWidth);
}

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
float Chilitags::getLatestAsyncDetectionIdleMillis(){
return mImpl->getLatestAsyncDetectionIdleMillis();
}
Expand Down
6 changes: 3 additions & 3 deletions src/Detect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Detect::Detect() :
mDecode(),
mFrame(),
mTags()
#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
,mBackgroundThread(),
mBackgroundRunning(false),
mNeedFrame(true),
Expand Down Expand Up @@ -84,7 +84,7 @@ void Detect::doDetection(TagCornerMap& tags)

void Detect::operator()(cv::Mat const& greyscaleImage, TagCornerMap& tags)
{
#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
//Run single threaded
if(!mBackgroundRunning){
mFrame = greyscaleImage;
Expand All @@ -110,7 +110,7 @@ void Detect::operator()(cv::Mat const& greyscaleImage, TagCornerMap& tags)
#endif
}

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
void Detect::launchBackgroundThread(Track& track)
{
if(!mBackgroundRunning){
Expand Down
6 changes: 3 additions & 3 deletions src/Detect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <map>

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
#include <pthread.h>
#endif

Expand All @@ -49,7 +49,7 @@ class Detect {

void operator()(cv::Mat const& inputImage, TagCornerMap& tags);

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
float getLatestAsyncIdleMillis();

float getLatestAsyncWorkMillis();
Expand All @@ -71,7 +71,7 @@ class Detect {

void doDetection(TagCornerMap& tags);

#ifdef WITH_PTHREADS
#ifdef HAS_MULTITHREADING
Track* mTrack;

pthread_t mBackgroundThread;
Expand Down

0 comments on commit c21a9fa

Please sign in to comment.