public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Replace deprecated pthread_yield in gdb.threads/watchpoint-fork.exp
@ 2022-12-31 6:31 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-12-31 6:31 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=32c960fac8d4d52d3afca088b3419e3e658d322e
commit 32c960fac8d4d52d3afca088b3419e3e658d322e
Author: Tom de Vries <tdevries@suse.de>
Date: Sat Dec 31 07:31:17 2022 +0100
[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.
Diff:
---
gdb/testsuite/gdb.threads/watchpoint-fork-mt.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
index a99e288350c..3cd3a5ea483 100644
--- a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
+++ b/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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-31 6:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-31 6:31 [binutils-gdb] [gdb/testsuite] Replace deprecated pthread_yield in gdb.threads/watchpoint-fork.exp Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).