#include <mrpt/synch.h>
#include <mrpt/utils/CTicTac.h>
#include <mrpt/random.h>
#include <mrpt/system.h>
#include <gtest/gtest.h>
Go to the source code of this file.
Classes | |
struct | TAux |
Functions | |
void | launchTestWithTimeout (void(*func)(void), double timeout_secs, const std::string &fail_msg) |
void | my_CriticalSections_Simple () |
TEST (Synch, CriticalSections_Simple) | |
void | thread_example (int id) |
void | my_CriticalSections_Multi () |
TEST (Synch, CriticalSections_Multi) | |
Variables | |
CCriticalSection | csCounter |
int | counter = 0 |
void launchTestWithTimeout | ( | void(*)(void) | func, |
double | timeout_secs, | ||
const std::string & | fail_msg | ||
) |
Definition at line 39 of file CCriticalSection_unittest.cpp.
References TAux::run(), mrpt::system::sleep(), and mrpt::utils::CTicTac::Tic().
Referenced by TEST().
void my_CriticalSections_Multi | ( | ) |
Definition at line 109 of file CCriticalSection_unittest.cpp.
References counter, mrpt::system::createThread(), csCounter, mrpt::synch::CCriticalSection::enter(), mrpt::synch::CCriticalSection::leave(), mrpt::random::randomGenerator, mrpt::random::CRandomGenerator::randomize(), mrpt::system::sleep(), and thread_example().
Referenced by TEST().
void my_CriticalSections_Simple | ( | ) |
Definition at line 60 of file CCriticalSection_unittest.cpp.
References mrpt::synch::CCriticalSection::enter(), and mrpt::synch::CCriticalSection::leave().
Referenced by TEST().
TEST | ( | Synch | , |
CriticalSections_Simple | |||
) |
Definition at line 66 of file CCriticalSection_unittest.cpp.
References launchTestWithTimeout(), and my_CriticalSections_Simple().
TEST | ( | Synch | , |
CriticalSections_Multi | |||
) |
Definition at line 126 of file CCriticalSection_unittest.cpp.
References launchTestWithTimeout(), and my_CriticalSections_Multi().
void thread_example | ( | int | id | ) |
Definition at line 76 of file CCriticalSection_unittest.cpp.
References counter, csCounter, delay, mrpt::random::CRandomGenerator::drawUniform(), MRPT_UNUSED_PARAM, mrpt::random::randomGenerator, and mrpt::system::sleep().
Referenced by my_CriticalSections_Multi().
int counter = 0 |
Definition at line 74 of file CCriticalSection_unittest.cpp.
Referenced by makeFilenameUnique(), my_CriticalSections_Multi(), mrpt::vision::relocalizeMultiDesc(), LegacyDataPacket::setPacketCounter(), thread_example(), mrpt::vision::updateBaseList(), and xsens::Packet::updateSampleCounter().
CCriticalSection csCounter |
Definition at line 73 of file CCriticalSection_unittest.cpp.
Referenced by my_CriticalSections_Multi(), and thread_example().
Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020 |