1#include <xrpl/beast/core/CurrentThreadName.h>
2#include <xrpl/beast/unit_test.h>
4#include <boost/predef/os.h>
27 if (!initialThreadName.empty())
50 char actualName[beast::maxThreadNameLength + 1] = {};
51 pthread_getname_np(pthread_self(), actualName,
sizeof(actualName));
53 BEAST_EXPECT(
std::string(actualName) == expectedName);
76 while (stateA == 0 || stateB == 0)
84 BEAST_EXPECT(stateA == 2);
85 BEAST_EXPECT(stateB == 2);
92 testName(
"123456789012345",
95 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.