From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id A6DE9384146A; Tue, 21 Jun 2022 00:16:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6DE9384146A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] libstdc++: testsuite: call sched_yield for nonpreemptive targets X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: e6f1daa833212e1d1c36d6d0b26e4593d91b564b X-Git-Newrev: 885b1748302b5a51ec247b5ca1a615f180c248bf Message-Id: <20220621001618.A6DE9384146A@sourceware.org> Date: Tue, 21 Jun 2022 00:16:18 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2022 00:16:18 -0000 https://gcc.gnu.org/g:885b1748302b5a51ec247b5ca1a615f180c248bf commit 885b1748302b5a51ec247b5ca1a615f180c248bf Author: Alexandre Oliva Date: Mon Jun 20 19:44:30 2022 -0300 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: --- libstdc++-v3/testsuite/30_threads/this_thread/60421.cc | 1 + 1 file changed, 1 insertion(+) 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) {