[patch] fix thread test cases for solaris.

Paolo Carlini paolo.carlini@oracle.com
Tue Jan 13 20:23:00 GMT 2009


Paolo Carlini wrote:
> The logic is that you need to AC_DEFINE _GLIBCXX_USE_SCHED_YIELD exactly
> whem you decide to append to GLIBCXX_LIBS, right after it, in that case.
>   
I don't know what I had in mind, exactly :) but this is not correct, of
course, sorry. Because for many targets, like linux, AC_SEARCH_LIBS
would not do anything, since sched_yield is already available.

Essentially, we just need a TRY_LINK test very similar to the one we
already have for clock_gettime, thus, in case, using additionally librt
or libposix4. You had already one in the first draft, only, in my
opinion, we should not hard code <sched.h>, we should do something very
similar to what AC_SEARCH_LIBS does under the hood, thus try to link
something like:

extern "C"
char sched_yield ();

int
main ()
{
sched_yield ();
  ;
  return 0;
}

Paolo.



More information about the Libstdc++ mailing list