Commit a14deb22 authored by Nick Connolly's avatar Nick Connolly Committed by Tomasz Zawadzki
Browse files

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: default avatarNick Connolly <nick.connolly@mayadata.io>
Change-Id: Ia841166f0537cd1303eded15bc7ef1a9f03e3b6e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6465


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 1d8861e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -648,7 +648,7 @@ _set_thread_name(const char *thread_name)
#elif defined(__FreeBSD__)
	pthread_set_name_np(pthread_self(), thread_name);
#else
#error missing platform support for thread name
	pthread_setname_np(pthread_self(), thread_name);
#endif
}