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>

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().

◆ TEST() [2/2]

TEST ( thread_name  ,
set_get_other_thread   
)

◆ 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().

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.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020