#include <mrpt/synch/CSemaphore.h>#include <mrpt/random.h>#include <mrpt/system/threads.h>#include <gtest/gtest.h>
Go to the source code of this file.
Functions | |
| void | launchTestWithTimeout (void(*func)(void), double timeout_secs, const std::string &fail_msg) | 
| void | sem_thread_example (int id) | 
| template<int num_threads, int initial_sem_count> | |
| void | my_CSemaphore () | 
| TEST (Synch, CSemaphore) | |
| 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_CSemaphore | ( | ) | 
Definition at line 68 of file CSemaphore_unittest.cpp.
References mrpt::system::createThread(), mrpt::system::joinThread(), sem_thread_example(), and mrpt::system::sleep().
| void sem_thread_example | ( | int | id | ) | 
Definition at line 29 of file CSemaphore_unittest.cpp.
References delay, mrpt::random::CRandomGenerator::drawUniform(), mrpt::mrpt::format(), mrpt::system::getCurrentThreadId(), MRPT_UNUSED_PARAM, mrpt::random::randomGenerator, mrpt::synch::CSemaphore::release(), mrpt::system::sleep(), and mrpt::synch::CSemaphore::waitForSignal().
Referenced by my_CSemaphore().
| TEST | ( | Synch | , | 
| CSemaphore | |||
| ) | 
Definition at line 85 of file CSemaphore_unittest.cpp.
References launchTestWithTimeout().
| Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |