diff options
author | Brad Smith <brad@comstyle.com> | 2022-12-18 03:22:04 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-02-17 09:56:34 +0100 |
commit | 3ada67a306904fe0eb3093aff9278439a0e093c8 (patch) | |
tree | 4519da6de0076fa630dddef2dc06deb8b352b206 /meson.build | |
parent | 6fbef9426bac7184b5d5887589d8386e732865eb (diff) |
thread-posix: add support for setting threads name on OpenBSD
Make use of pthread_set_name_np() to be able to set the threads name
on OpenBSD.
Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <Y57NrCmPTVSXLWC4@humpty.home.comstyle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/meson.build b/meson.build index a76c855312..86e8ff9109 100644 --- a/meson.build +++ b/meson.build @@ -2133,6 +2133,18 @@ config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_WO_TID', cc.links(gnu_source_pre pthread_create(&thread, 0, f, 0); return 0; }''', dependencies: threads)) +config_host_data.set('CONFIG_PTHREAD_SET_NAME_NP', cc.links(gnu_source_prefix + ''' + #include <pthread.h> + #include <pthread_np.h> + + static void *f(void *p) { return NULL; } + int main(void) + { + pthread_t thread; + pthread_create(&thread, 0, f, 0); + pthread_set_name_np(thread, "QEMU"); + return 0; + }''', dependencies: threads)) config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(gnu_source_prefix + ''' #include <pthread.h> #include <time.h> |