[patch] fix thread test cases for solaris.

Chris Fairles chris.fairles@gmail.com
Sun Jan 11 02:04:00 GMT 2009


On Sat, Jan 10, 2009 at 5:40 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> .. by the way, whereas I can see a simple way to tighten on nanosleep
> (i.e., change the existing autoconf test to GCC_TRY_COMPILE_OR_LINK) I'm
> really puzzled by the sched_yield issue (AFAIK, in the code at issue is
> not explicitly called anywhere!).

testsuite/30_threads/thread/this_thread/2.cc uses
std::this_thread::yield(); which is based on __gthread_yield() which
in turn is just a sched_yield().

We have --enable-clock-gettime=rt to solve this for clock_gettime,
perhaps we a --enable-nanosleep=rt, --enable-sched_yield=rt or
something more general. Short term I could change the nanosleep to
GCC_TRY_COMPILE_OR_LINK and make a GLIBCXX_CHECK_SCHED_YIELD that does
the same. That should at least get those tests to pass w/o modifying
them.

Chris



More information about the Gcc-patches mailing list