mirror of
https://sourceware.org/git/glibc.git
synced 2025-09-02 16:01:20 +03:00
We add sched_yield() API testing to the existing thread affinity test case because it allows us to test sched_yield() operation in the following scenarios: * On a main thread. * On multiple threads simultaneously. * On every CPU the system reports simultaneously. The ensures we exercise sched_yield() in as many scenarios as we would exercise calls to the affinity functions. Additionally, the test is improved by adding a semaphore to coordinate all the threads running, so that an early starter thread won't consume cpu resources that could be used to start the other threads. Co-authored-by: DJ Delorie <dj@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>