]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: testsuite: call sched_yield for nonpreemptive targets
authorAlexandre Oliva <oliva@adacore.com>
Wed, 22 Jun 2022 02:11:01 +0000 (23:11 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 22 Jun 2022 02:11:01 +0000 (23:11 -0300)
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.

libstdc++-v3/testsuite/30_threads/this_thread/60421.cc

index ad6f9aeffcc803c439f0ee9d5ed8c431205b1438..12dbeba1cc49283890a80e22ed5920c2598005bd 100644 (file)
@@ -59,6 +59,7 @@ test02()
   while (!sleeping)
   {
     // Wait for the thread to start sleeping.
+    sched_yield ();
   }
   while (sleeping)
   {