25 using namespace folly;
38 if (expectedSetSelfThreadNameResult) {
47 #if FOLLY_HAVE_PTHREAD 48 TEST(ThreadName, setThreadName_other_pthread) {
53 handle = pthread_self();
55 let_thread_end.
wait();
62 let_thread_end.
post();
65 expectedSetOtherThreadNameResult,
setThreadName(handle, kThreadName));
69 TEST(ThreadName, setThreadName_other_id) {
71 thread th([&] { let_thread_end.
wait(); });
76 let_thread_end.
post();
79 expectedSetOtherThreadNameResult,
81 if (expectedSetOtherThreadNameResult) {
Optional< std::string > getThreadName(std::thread::id id)
#define EXPECT_EQ(val1, val2)
bool canSetOtherThreadName()
—— Concurrent Priority Queue Implementation ——
FOLLY_ALWAYS_INLINE void wait(const WaitOptions &opt=wait_options()) noexcept
bool canSetCurrentThreadName()
bool setThreadName(std::thread::id tid, StringPiece name)
TEST(ThreadName, getCurrentThreadName)
Optional< std::string > getCurrentThreadName()