MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / SetThreadName

Function SetThreadName

libi2pd/util.cpp:183–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 }
182
183 void SetThreadName (const char *name) {
184#if defined(__APPLE__)
185# if (!defined(MAC_OS_X_VERSION_10_6) || \
186 (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) || \
187 defined(__POWERPC__))
188 /* pthread_setname_np is not there on <10.6 and all PPC.
189 So do nothing. */
190# else
191 pthread_setname_np((char*)name);
192# endif
193#elif defined(__FreeBSD__) || defined(__OpenBSD__)
194 pthread_set_name_np(pthread_self(), name);
195#elif defined(__NetBSD__)
196 pthread_setname_np(pthread_self(), "%s", (void *)name);
197#elif !defined(__gnu_hurd__)
198 #if defined(_MSC_VER)
199 THREADNAME_INFO info;
200 info.dwType = 0x1000;
201 info.szName = name;
202 info.dwThreadID = -1;
203 info.dwFlags = 0;
204 #pragma warning(push)
205 #pragma warning(disable: 6320 6322)
206 __try {
207 RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
208 }
209 __except (EXCEPTION_EXECUTE_HANDLER) {
210 }
211 #pragma warning(pop)
212 #else
213 pthread_setname_np(pthread_self(), name);
214 #endif
215#endif
216 }
217
218 size_t Mapping::FromBuffer (const uint8_t * buf, size_t len)
219 {

Callers 13

TryResolvingMethod · 0.85
CheckUpdatesMethod · 0.85
runMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected