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]

configure bits for clock_nanosleep and nanosleep.


To implement sleep_for/sleep_until in 30.2.2 (std::this_thread) I can
use clock_nanosleep if available, and if not, nanosleep if its
available. If neither are available I think there's ways to emulate
those functions using condition variables as a fall back.

nanosleep is available in glibc. clock_nanosleep is the same deal as
clock_gettime, either libposix4 or librt.

For clock_nanosleep, its first input is one of CLOCK_REALTIME or
CLOCK_MONOTONIC, both are already checked in the clock_gettime check.
I was thinking about extending the clock_gettime check to include
clock_nanosleep as well. Does this seem like the best way? It
unfortunately means that the --enable-clock-gettime option would also
extend to clock-nanosleep. The alternative I guess is to make an
--enable-clock-nanosleep with exactly the same logic as gettime.

For nanosleep, I'm checking for it spearately but is an AC_TRY_COMPILE
sufficient or do we need a TRY_COMPILE_OR_LINK as well?

Chris


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