[gdb/testsuite] Replace deprecated pthread_yield in gdb.threads/watchpoint-fork.exp
authorTom de Vries <tdevries@suse.de>
Sat, 31 Dec 2022 06:31:17 +0000 (07:31 +0100)
committerTom de Vries <tdevries@suse.de>
Sat, 31 Dec 2022 06:31:17 +0000 (07:31 +0100)
commit32c960fac8d4d52d3afca088b3419e3e658d322e
treebfbee9bd5b4b7cd0a18c1a5b0e1d685aaa168092
parente64ddcc663b79cf2ceb51be8dc175982049715b2
[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.
gdb/testsuite/gdb.threads/watchpoint-fork-mt.c