[vlc-devel] [PATCH] thread: Have vlc_GetCPUCount make use of _SC_NPROCESSORS_ONLN

Sean McGovern gseanmcg at gmail.com
Sun Apr 11 21:05:01 UTC 2021


Seems simple enough, but I wonder if the preprocessor #if stanza above
it couldn't be modified to catch this instead.

That said, my comment should be considered pedantic and feel free to ignore it.

-- Sean McG.

On Sat, Apr 10, 2021 at 4:09 PM Brad Smith via vlc-devel
<vlc-devel at videolan.org> wrote:
>
> ping.
>
> On 4/3/2021 4:47 PM, Brad Smith wrote:
> > thread: Have vlc_GetCPUCount make use of _SC_NPROCESSORS_ONLN
> >
> > OpenBSD and other OS's use _SC_NPROCESSORS_ONLN to indicate the number
> > of online CPUs.
> > ---
> >   src/posix/thread.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/src/posix/thread.c b/src/posix/thread.c
> > index d617bd7292..28975b1f93 100644
> > --- a/src/posix/thread.c
> > +++ b/src/posix/thread.c
> > @@ -308,6 +308,8 @@ unsigned vlc_GetCPUCount(void)
> >           count = sysconf (_SC_NPROCESSORS_ONLN);
> >       free (cpulist);
> >       return count ? count : 1;
> > +#elif defined(_SC_NPROCESSORS_ONLN)
> > +    return sysconf(_SC_NPROCESSORS_ONLN);
> >   #elif defined(_SC_NPROCESSORS_CONF)
> >       return sysconf(_SC_NPROCESSORS_CONF);
> >   #else
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list