lib/event: improve portability
In _set_thread_name, use pthread_setname_np as the default for platforms that are not Linux or FreeBSD; it's the most common 'non-portable' pthread extension used to set the thread name. Signed-off-by: Nick Connolly <nick.connolly@mayadata.io> Change-Id: Ia841166f0537cd1303eded15bc7ef1a9f03e3b6e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6465 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
1d8861e58f
commit
a14deb22e0
@ -648,7 +648,7 @@ _set_thread_name(const char *thread_name)
|
|||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
pthread_set_name_np(pthread_self(), thread_name);
|
pthread_set_name_np(pthread_self(), thread_name);
|
||||||
#else
|
#else
|
||||||
#error missing platform support for thread name
|
pthread_setname_np(pthread_self(), thread_name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user