mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 17:17:47 +08:00
fixing more ci erros
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <opencv2/core.hpp>
|
#include <opencv2/core.hpp>
|
||||||
|
#if CV_MAJOR_VERSION < 3
|
||||||
|
#ifdef HAVE_OPENCV_GPU
|
||||||
|
#include <opencv2/gpu/gpu.hpp>
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#include <opencv2/core/cuda.hpp>
|
||||||
|
#endif
|
||||||
#include "rtabmap/core/VWDictionary.h"
|
#include "rtabmap/core/VWDictionary.h"
|
||||||
#include "rtabmap/core/VisualWord.h"
|
#include "rtabmap/core/VisualWord.h"
|
||||||
#include "rtabmap/core/Parameters.h"
|
#include "rtabmap/core/Parameters.h"
|
||||||
|
|||||||
@@ -175,7 +175,12 @@ TEST(USemaphoreTest, ThreadSafety)
|
|||||||
for(int i = 0; i < numThreads * iterations; ++i)
|
for(int i = 0; i < numThreads * iterations; ++i)
|
||||||
{
|
{
|
||||||
sem.release();
|
sem.release();
|
||||||
std::this_thread::sleep_for(std::chrono::microseconds(10));
|
// yield() instead of sleep_for(10us): Windows's default 15.6ms
|
||||||
|
// timer tick turns "10us" into ~15ms, blowing this 400-iter loop
|
||||||
|
// up to ~6s on Windows CI for no benefit. yield() still lets the
|
||||||
|
// waiting acquirers run between releases without the wall-clock
|
||||||
|
// cost.
|
||||||
|
std::this_thread::yield();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user