1#include <xrpl/beast/core/CurrentThreadName.h>
2#include <xrpl/beast/unit_test.h>
4#include <boost/predef/os.h>
30 if (!initialThreadName.empty())
53 char actualName[beast::maxThreadNameLength + 1] = {};
54 pthread_getname_np(pthread_self(), actualName,
sizeof(actualName));
56 BEAST_EXPECT(
std::string(actualName) == expectedName);
79 while (stateA == 0 || stateB == 0)
87 BEAST_EXPECT(stateA == 2);
88 BEAST_EXPECT(stateB == 2);
99 "1234567890123456",
"123456789012345");
101 "ThisIsAVeryLongThreadNameExceedingLimit",
104 testName(
"short",
"short");
static void exerciseName(std::string myName, std::atomic< bool > *stop, std::atomic< int > *state)
void run() override
Runs the suite.
void setCurrentThreadName(std::string_view newThreadName)
Changes the name of the caller thread.
std::string getCurrentThreadName()
Returns the name of the caller thread.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.