[FFmpeg-devel] [PATCH] lavu: add ff_pthread_setname() and use it in various places

Clément Bœsch u at pkh.me
Sun Jan 24 13:58:29 CET 2016


On Wed, Jan 20, 2016 at 09:15:15PM -0300, James Almer wrote:
> On 1/20/2016 7:46 PM, Clément Bœsch wrote:
> > diff --git a/libavutil/thread.h b/libavutil/thread.h
> > index 32ddf40..42430fb 100644
> > --- a/libavutil/thread.h
> > +++ b/libavutil/thread.h
> > @@ -31,6 +31,15 @@
> >  #if HAVE_PTHREADS
> >  #include <pthread.h>
> >  
> > +static inline void ff_thread_setname(const char *name)
> > +{
> > +#if defined(__APPLE__)
> > +    pthread_setname_np(name);
> > +#elif defined(__linux__) && defined(__GLIBC__)
> > +    pthread_setname_np(pthread_self(), name);
> > +#endif
> > +}
> > +
> >  #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
> >  
> >  #include "log.h"
> > @@ -143,6 +152,7 @@ static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_
> >  #define AV_ONCE_INIT PTHREAD_ONCE_INIT
> >  
> >  #define ff_thread_once(control, routine) pthread_once(control, routine)
> > +#define ff_thread_setname(name) (0)
> 
> This is also being applied to pthreads.

Damn, it's not a good excuse but I was tired and in a hurry that day.
Thanks for your patience, new patch attached.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavu-add-ff_pthread_setname-and-use-it-in-various-pl.patch
Type: text/x-diff
Size: 4457 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160124/51f42feb/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160124/51f42feb/attachment.sig>


More information about the ffmpeg-devel mailing list