On Wed, 22 Jun 2022 at 06:26, Alexandre Oliva via Libstdc++ <libstd...@gcc.gnu.org> wrote: > > > Though sleep, nanosleep and clock_nanosleep are all POSIX cancellation > points, not all target systems follow this POSIX requirement. > 30_threads/thread/native_handle/cancel.cc will run until it times out > on such systems. > > Rather than failing a C++ library test because of a limitation of the > target system, this patch gives the test a chance to successfully > exercise the features it intends to exercise, by introducing a > cancellation point in a loop that would otherwise run indefinitely on > systems exhibiting this limitation. > > Regstrapped on x86_64-linux-gnu, also tested with a cross to > aarch64-rtems6. Ok to install?
OK, thanks. This test is already explicitly pthread-specific, so there's no problem using pthread_testcancel there. It already uses pthread_cancel, and is gated by: // { dg-require-effective-target pthread }