This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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.


Hi again,
> 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:
>   
I just realized that this idea is again not ok :( The problem is that
both when yes and rt we would look for sched_yield and that is an
implementation detail of __gthread_yield, which may well not use it.

No, I think that what's really needed is exactly an open-coded test for
__gthread_yield completely similar to [GLIBCXX_ENABLE_THREADS], but
AC_TRY_LINK.

That would be of course after the tests for clock_gettime, thus perhaps
also linking librt or libposix4 if the user allowed that.

I think it's still ok to look specifically for sched_yield in the
AC_SEARCH_LIBS, because, if it is found in librt or libposix4, seems
likely it is used in the implementation of __gthread_yield and in any
case we are only risking of linking librt or libposix4 unnecessarily
(unlikely and the user allowed that). If in the future people will point
out other functions used in the implementation of __gthread_yield *and*
only available in librt or libposix4, we'll see...

Chris, can you play with the above? Otherwise I can pick your drafts...

Thanks,
Paolo.


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