MRPT  2.0.4
Functions | Variables
thread_name_unittest.cpp File Reference
#include <gtest/gtest.h>
#include <mrpt/config.h>
#include <mrpt/core/format.h>
#include <mrpt/system/thread_name.h>
#include <atomic>
#include <condition_variable>
Include dependency graph for thread_name_unittest.cpp:

Go to the source code of this file.

Functions

 TEST (thread_name, set_get_current_thread)
 
static void testerThread (const std::string &myName)
 
 TEST (thread_name, set_get_other_thread)
 

Variables

static std::condition_variable cv
 
static std::condition_variable cv2
 
static std::mutex cv_m
 
static std::mutex cv2_m
 
static std::atomic< int > thrCnt = 0
 
static std::atomic< int > thrDone = 0
 
static const std::string sNewName = "NewName"
 

Function Documentation

◆ TEST() [1/2]

TEST ( thread_name  ,
set_get_current_thread   
)

Definition at line 21 of file thread_name_unittest.cpp.

References EXPECT_EQ(), and mrpt::system::thread_name().

Here is the call graph for this function:

◆ TEST() [2/2]

TEST ( thread_name  ,
set_get_other_thread   
)

Definition at line 80 of file thread_name_unittest.cpp.

References cv2, cv2_m, cv_m, EXPECT_EQ(), mrpt::format(), names, sNewName, testerThread(), thrCnt, thrDone, and mrpt::system::thread_name().

Here is the call graph for this function:

◆ testerThread()

static void testerThread ( const std::string &  myName)
static

Definition at line 45 of file thread_name_unittest.cpp.

References cv2, cv2_m, cv_m, EXPECT_EQ(), sNewName, thrCnt, thrDone, and mrpt::system::thread_name().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ cv

std::condition_variable cv
static

Definition at line 38 of file thread_name_unittest.cpp.

◆ cv2

std::condition_variable cv2
static

Definition at line 38 of file thread_name_unittest.cpp.

Referenced by TEST(), and testerThread().

◆ cv2_m

std::mutex cv2_m
static

Definition at line 39 of file thread_name_unittest.cpp.

Referenced by TEST(), and testerThread().

◆ cv_m

std::mutex cv_m
static

Definition at line 39 of file thread_name_unittest.cpp.

Referenced by TEST(), and testerThread().

◆ sNewName

const std::string sNewName = "NewName"
static

Definition at line 43 of file thread_name_unittest.cpp.

Referenced by TEST(), and testerThread().

◆ thrCnt

std::atomic<int> thrCnt = 0
static

Definition at line 40 of file thread_name_unittest.cpp.

Referenced by TEST(), and testerThread().

◆ thrDone

std::atomic<int> thrDone = 0
static

Definition at line 41 of file thread_name_unittest.cpp.

Referenced by TEST(), and testerThread().




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020