MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / RenameThread

Function RenameThread

src/commons/util/util.cpp:983–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

981}
982
983void RenameThread(const char* name) {
984#if defined(PR_SET_NAME)
985 // Only the first 15 characters are used (16 - NUL terminator)
986 ::prctl(PR_SET_NAME, name, 0, 0, 0);
987#elif 0 && (defined(__FreeBSD__) || defined(__OpenBSD__))
988 // TODO: This is currently disabled because it needs to be verified to work
989 // on FreeBSD or OpenBSD first. When verified the '0 &&' part can be
990 // removed.
991 pthread_set_name_np(pthread_self(), name);
992
993#elif defined(MAC_OSX) && defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
994
995// pthread_setname_np is XCode 10.6-and-later
996#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
997 pthread_setname_np(name);
998#endif
999
1000#else
1001 // Prevent warnings for unused parameters...
1002 (void)name;
1003#endif
1004}
1005
1006void SetupEnvironment() {
1007#ifndef WIN32

Callers 15

DetectShutdownThreadFunction · 0.85
ShutdownFunction · 0.85
ThreadImportFunction · 0.85
ThreadFlushWalletDBFunction · 0.85
ThreadRelayTxFunction · 0.85
SendTxMethod · 0.85
CommonTxGeneratorFunction · 0.85
ContractTxGeneratorFunction · 0.85
WasmTxGeneratorFunction · 0.85
ThreadHTTPFunction · 0.85
HTTPWorkQueueRunFunction · 0.85
runnerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected