From 89a2dc46dd8f84fa199eebaed4e18492e4eae8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Wed, 27 Jun 2018 15:19:24 +0200 Subject: [PATCH] libs/vkd3d: Set names for internal threads. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- configure.ac | 2 ++ libs/vkd3d/command.c | 4 ++++ libs/vkd3d/vkd3d_private.h | 8 +++++--- m4/check-functions.m4 | 7 +++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index daae6464..2773a155 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,8 @@ VKD3D_CHECK_FUNC([HAVE_BUILTIN_POPCOUNT], [__builtin_popcount], [__builtin_popco VKD3D_CHECK_FUNC([HAVE_SYNC_ADD_AND_FETCH], [__sync_add_and_fetch], [__sync_add_and_fetch((int *)0, 0)]) VKD3D_CHECK_FUNC([HAVE_SYNC_SUB_AND_FETCH], [__sync_sub_and_fetch], [__sync_sub_and_fetch((int *)0, 0)]) +VKD3D_CHECK_LIB_FUNCS([pthread_setname_np], [$PTHREAD_LIBS]) + AM_CONDITIONAL([HAVE_WIDL], [test "x$WIDL" != "xno"]) AM_CONDITIONAL([HAVE_CROSSTARGET32], [test "x$CROSSTARGET32" != "xno"]) AM_CONDITIONAL([HAVE_CROSSTARGET64], [test "x$CROSSTARGET64" != "xno"]) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index ee1d3f6e..d29d18ed 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -199,6 +199,10 @@ static void *vkd3d_fence_worker_main(void *arg) struct vkd3d_fence_worker *worker = arg; int rc; +#ifdef HAVE_PTHREAD_SETNAME_NP + pthread_setname_np(pthread_self(), "vkd3d_worker"); +#endif + for (;;) { if ((rc = pthread_mutex_lock(&worker->mutex))) diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 38f0bf38..29611b8c 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -19,12 +19,14 @@ #ifndef __VKD3D_PRIVATE_H #define __VKD3D_PRIVATE_H -#define VK_NO_PROTOTYPES - #define COBJMACROS #define NONAMELESSUNION -#include "vkd3d.h" +#define VK_NO_PROTOTYPES + +#include "vkd3d_common.h" #include "vkd3d_memory.h" + +#include "vkd3d.h" #include "vkd3d_shader.h" #include diff --git a/m4/check-functions.m4 b/m4/check-functions.m4 index 8bb82131..17082a17 100644 --- a/m4/check-functions.m4 +++ b/m4/check-functions.m4 @@ -7,3 +7,10 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return [$3]; }])], [1], [Define to 1 if you have $2.])], [AC_MSG_RESULT([no])])]) + +dnl VKD3D_CHECK_LIB_FUNCS +AC_DEFUN([VKD3D_CHECK_LIB_FUNCS], +[vkd3d_libs_saved="$LIBS" +LIBS="$LIBS $2" +AC_CHECK_FUNCS([$1], [$3], [$4]) +LIBS="$vkd3d_libs_saved"])