mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 12:15:15 +00:00
Adds thread names on OS X
This commit is contained in:
parent
820f1e9668
commit
078a0df62d
3 changed files with 17 additions and 0 deletions
|
|
@ -26,6 +26,14 @@
|
|||
/* **************************************************** */
|
||||
|
||||
static void* doRun(void* ptr) {
|
||||
#ifdef __APPLE__
|
||||
// Mac OS X: must be set from within the thread (can't specify thread ID)
|
||||
char buf[MAX_PATH];
|
||||
snprintf(buf, sizeof(buf), "ThreadPool worker");
|
||||
if(pthread_setname_np(buf))
|
||||
ntop->getTrace()->traceEvent(TRACE_WARNING, "Unable to set pthread name %s", buf);
|
||||
#endif
|
||||
|
||||
((ThreadPool*)ptr)->run();
|
||||
return(NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue