From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 33865486E3 for ; Tue, 16 Jan 2024 06:25:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5E9D568CB0C; Tue, 16 Jan 2024 08:25:25 +0200 (EET) Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C27F068C55B for ; Tue, 16 Jan 2024 08:25:18 +0200 (EET) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4TDfBj0bDqz8PbP for ; Tue, 16 Jan 2024 01:25:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=comstyle.com; h= content-type:message-id:date:mime-version:subject:from:to :references:in-reply-to; s=default; bh=kVD3PJ8t/DAwv0iGqzrJ9U8Ex TE=; b=JiSTp1CtBmPYDQIGx0Ezv1D768XRG8LZX3ObOhOYKn7ek3zqbST2GnP6i NNBd9PT0GeoQxzPdcq5zNiEQihYtgKi1Kq8inZhWlWuKKKSeYX7TTwwV1Wsxj0eX A8CdsTiqCCWRvHyAUQ19AhPjwk89OFLaMT4K6/6uI+IDl/61ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=content-type :message-id:date:mime-version:subject:from:to:references :in-reply-to; q=dns; s=default; b=XwtZkq3d10HNwaCnQFoYeTLf0qn2xE JwMxLxTRZ3/d7U1LpP8MRxXSZBhZOd3IPMlTj3QafNGCxxmON20PJww/iFFozEuC eEMR7JNM4JJkf/LmpND/0qRly91n7+xJR2V9BsXkQ3IL/h1JxxmYY9KZrjrpzf+U 1HJPhylj/KOO8= Received: from [IPV6:2001:470:b050:6:cc31:46d5:f26a:a82b] (unknown [IPv6:2001:470:b050:6:cc31:46d5:f26a:a82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4TDfBh5089z8PbN for ; Tue, 16 Jan 2024 01:25:16 -0500 (EST) Message-ID: <54479357-fbd4-4226-8c27-3bfceacc516c@comstyle.com> Date: Tue, 16 Jan 2024 01:25:14 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Brad Smith To: FFmpeg development discussions and patches References: Content-Language: en-US In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH v2] lavu/thread: add support for setting thread name on *bsd and solaris X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 2024-01-07 12:55 a.m., Brad Smith wrote: > lavu/thread: add support for setting thread name on *bsd and solaris > > FreeBSD/DragonFly/Solaris use pthread_setname_np(). OpenBSD uses pthread_set_name_np(). > > Signed-off-by: Brad Smith > --- > configure | 10 ++++++++++ > libavutil/thread.h | 14 ++++++++++++-- > 2 files changed, 22 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index 0b5e83bd20..67660b6292 100755 > --- a/configure > +++ b/configure > @@ -2239,6 +2239,7 @@ HEADERS_LIST=" > opencv2_core_core_c_h > OpenGL_gl3_h > poll_h > + pthread_np_h > sys_param_h > sys_resource_h > sys_select_h > @@ -2341,6 +2342,8 @@ SYSTEM_FUNCS=" > posix_memalign > prctl > pthread_cancel > + pthread_set_name_np > + pthread_setname_np > sched_getaffinity > SecItemImport > SetConsoleTextAttribute > @@ -6523,6 +6526,7 @@ check_headers malloc.h > check_headers mftransform.h > check_headers net/udplite.h > check_headers poll.h > +check_headers pthread_np.h > check_headers sys/param.h > check_headers sys/resource.h > check_headers sys/select.h > @@ -6691,6 +6695,12 @@ if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then > if enabled pthreads; then > check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs > check_func pthread_cancel $pthreads_extralibs > + hdrs=pthread.h > + if enabled pthread_np_h; then > + hdrs="$hdrs pthread_np.h" > + fi > + check_lib pthread_set_name_np "$hdrs" pthread_set_name_np -lpthread > + check_lib pthread_setname_np "$hdrs" pthread_setname_np -lpthread > fi > fi > > diff --git a/libavutil/thread.h b/libavutil/thread.h > index 2ded498c89..fa74dd2ea7 100644 > --- a/libavutil/thread.h > +++ b/libavutil/thread.h > @@ -26,6 +26,8 @@ > > #if HAVE_PRCTL > #include > +#elif (HAVE_PTHREAD_SETNAME_NP || HAVE_PTHREAD_SET_NAME_NP) && HAVE_PTHREAD_NP_H > +#include > #endif > > #include "error.h" > @@ -213,11 +215,19 @@ static inline int ff_thread_once(char *control, void (*routine)(void)) > > static inline int ff_thread_setname(const char *name) > { > + int ret = 0; > + > #if HAVE_PRCTL > - return AVERROR(prctl(PR_SET_NAME, name)); > + ret = AVERROR(prctl(PR_SET_NAME, name)); > +#elif HAVE_PTHREAD_SETNAME_NP > + ret = AVERROR(pthread_setname_np(pthread_self(), name)); > +#elif HAVE_PTHREAD_SET_NAME_NP > + pthread_set_name_np(pthread_self(), name); > +#else > + ret = AVERROR(ENOSYS); > #endif > > - return AVERROR(ENOSYS); > + return ret; > } > > #endif /* AVUTIL_THREAD_H */ ping. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".