KVM: selftests: change pthread_yield to sched_yield
With later GCC we get steal_time.c: In function ‘main’: steal_time.c:323:25: warning: ‘pthread_yield’ is deprecated: pthread_yield is deprecated, use sched_yield instead [-Wdeprecated-declarations] Let's follow the instructions and use sched_yield instead. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210713203742.29680-2-drjones@redhat.com
This commit is contained in:
Родитель
80d9ac9bd7
Коммит
bac0b13590
|
@ -320,7 +320,7 @@ int main(int ac, char **av)
|
|||
run_delay = get_run_delay();
|
||||
pthread_create(&thread, &attr, do_steal_time, NULL);
|
||||
do
|
||||
pthread_yield();
|
||||
sched_yield();
|
||||
while (get_run_delay() - run_delay < MIN_RUN_DELAY_NS);
|
||||
pthread_join(thread, NULL);
|
||||
run_delay = get_run_delay() - run_delay;
|
||||
|
|
Загрузка…
Ссылка в новой задаче