Browse Source

[gdb/testsuite] Replace deprecated pthread_yield in gdb.threads/watchpoint-fork.exp

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.
users/ahajkova/try-frob
Tom de Vries 4 years ago
parent
commit
32c960fac8
  1. 10
      gdb/testsuite/gdb.threads/watchpoint-fork-mt.c

10
gdb/testsuite/gdb.threads/watchpoint-fork-mt.c

@ -64,7 +64,7 @@ start (void *arg)
while (step != 1)
{
i = pthread_yield ();
i = sched_yield ();
assert (i == 0);
}
@ -76,7 +76,7 @@ start (void *arg)
if (step == 99)
goto step_99;
i = pthread_yield ();
i = sched_yield ();
assert (i == 0);
}
@ -92,7 +92,7 @@ step_3:
if (step == 99)
goto step_99;
i = pthread_yield ();
i = sched_yield ();
assert (i == 0);
}
@ -132,7 +132,7 @@ main (void)
step = 1;
while (step != 2)
{
i = pthread_yield ();
i = sched_yield ();
assert (i == 0);
}
@ -149,7 +149,7 @@ main (void)
#endif
while (step != 4)
{
i = pthread_yield ();
i = sched_yield ();
assert (i == 0);
}

Loading…
Cancel
Save