From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Replace deprecated pthread_yield in gdb.threads/watchpoint-fork.exp
Date: Sat, 31 Dec 2022 07:31:33 +0100 [thread overview]
Message-ID: <20221231063133.29613-1-tdevries@suse.de> (raw)
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 | 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 @@ start (void *arg)
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);
}
base-commit: e64ddcc663b79cf2ceb51be8dc175982049715b2
--
2.35.3
reply other threads:[~2022-12-31 6:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221231063133.29613-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).