On Wed, 24 Jun 2026 at 10:53, Alexandre Oliva <[email protected]> wrote:
>
>
> ac_has_sched_yield is a bit of a misnomer in libstdc++-v3, as it
> guards the __gthread_yield call. That call is implemented on VxWorks,
> even where it doesn't support POSIX sched_yield() proper. So enable
> it.
>
> Regstrapped on x86_64-linux-gnu. Also tested with various vxworks ports
> with gcc-15 and earlier. I'm going to put this in shortly.
Maybe we should consider renaming _GLIBCXX_USE_SCHED_YIELD to
_GLIBCXX_USE_GTHREAD_YIELD, and then make it be defined in
acinclude.m4 like so:
if test x"$ac_has_gthread_yield" = x; then
ac_has_gthread_yield="$ac_has_sched_yield"
fi
if test x"$ac_has_gthread_yield" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_GTHREAD_YIELD, 1,
[ Defined if __gthread_yield is available. ])
fi
That way the macro in the headers would not be a misnomer, and targets
which have __gthread_yield but not sched_yield can say so explicitly,
instead of pretending to have sched_yield.
What do you think?