This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] fix thread test cases for solaris.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]