This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix thread test cases for solaris.
- From: "Chris Fairles" <chris dot fairles at gmail dot com>
- To: "Paolo Carlini" <paolo dot carlini at oracle dot com>
- Cc: "Andreas Tobler" <andreast-list at fgznet dot ch>, "GCC Patches" <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 10 Jan 2009 19:24:18 -0500
- Subject: Re: [patch] fix thread test cases for solaris.
- References: <4968E8B0.4070204@fgznet.ch> <49691BCF.4010107@oracle.com> <496923C5.2020906@oracle.com>
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