From: Alexandre Oliva Date: Wed, 22 Jun 2022 02:11:01 +0000 (-0300) Subject: libstdc++: testsuite: call sched_yield for nonpreemptive targets X-Git-Tag: basepoints/gcc-14~6007 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f129628e8f261b66a34a9626e1f5b0293548a6a8;p=thirdparty%2Fgcc.git libstdc++: testsuite: call sched_yield for nonpreemptive targets As in the gcc testsuite, systems without preemptive multi-threading require sched_yield calls to be placed at points in which a context switch might be needed to enable the test to complete. for libstdc++-v3/ChangeLog * testsuite/30_threads/this_thread/60421.cc (test02): Call sched_yield. --- diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/60421.cc b/libstdc++-v3/testsuite/30_threads/this_thread/60421.cc index ad6f9aeffcc..12dbeba1cc4 100644 --- a/libstdc++-v3/testsuite/30_threads/this_thread/60421.cc +++ b/libstdc++-v3/testsuite/30_threads/this_thread/60421.cc @@ -59,6 +59,7 @@ test02() while (!sleeping) { // Wait for the thread to start sleeping. + sched_yield (); } while (sleeping) {