On Ubuntu 22.04.1 x86_64, with glibc 2.35 I run into:
...
watchpoint-fork-mt.c: In function 'start':^M
watchpoint-fork-mt.c:67:7: warning: 'pthread_yield' is deprecated: \
pthread_yield is deprecated, use sched_yield instead \
[-Wdeprecated-declarations]^M
67 | i = pthread_yield ();^M
| ^^M
...
Fix this as suggested, by using sched_yield instead.
Tested on x86_64-linux.
while (step != 1)
{
- i = pthread_yield ();
+ i = sched_yield ();
assert (i == 0);
}
if (step == 99)
goto step_99;
- i = pthread_yield ();
+ i = sched_yield ();
assert (i == 0);
}
if (step == 99)
goto step_99;
- i = pthread_yield ();
+ i = sched_yield ();
assert (i == 0);
}
step = 1;
while (step != 2)
{
- i = pthread_yield ();
+ i = sched_yield ();
assert (i == 0);
}
#endif
while (step != 4)
{
- i = pthread_yield ();
+ i = sched_yield ();
assert (i == 0);
}