=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: libs/vkd3d: Set names for internal threads.

Alexandre Julliard julliard at winehq.org
Wed Jun 27 16:03:24 CDT 2018


Module: vkd3d
Branch: master
Commit: 89a2dc46dd8f84fa199eebaed4e18492e4eae8ed
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=89a2dc46dd8f84fa199eebaed4e18492e4eae8ed

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Jun 27 15:19:24 2018 +0200

libs/vkd3d: Set names for internal threads.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 daae646..2773a15 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 ee1d3f6..d29d18e 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 38f0bf3..29611b8 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 <assert.h>
diff --git a/m4/check-functions.m4 b/m4/check-functions.m4
index 8bb8213..17082a1 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"])




More information about the wine-cvs mailing list