examples/performance-thread: fix build issue with clang 12.0.1
PATCH 1/1 examples/performance-thread: fix build issue with clang 12.0.1
From: Jerin Jacob <[email protected]>
In clang 12.0.1 version, the use of pthread_yield() deprecated, use sched_yield() instead.
log:
Compiling C object examples/dpdk-pthread_shim.p/performance-thread_pthread_shim_main.c.o ../examples/performance-thread/pthread_shim/main.c: In function 'helloworld_pthread':../examples/performance-thread/pthread_shim/main.c:75:9: warning:
'pthread_yield' is deprecated: pthread_yield is deprecated, use sched_yield instead [-Wdeprecated-declarations]
Bugzilla ID: 745
--- examples/performance-thread/pthread_shim/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/performance-thread/pthread_shim/main.c +1 -1
@@ -72,7 +72,7 @@ void *helloworld_pthread(void *arg) print_count++;/* yield thread to give opportunity for lock contention */ -pthread_yield (); +sched_yield ();/* retrieve arg from TLS */ uint64_t thread_no = (uint64_t )pthread_getspecific (key);
Signature · 1 line
2.32.0
Quoted 29 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Monday, August 16, 2021 4:19 PM
To: John McNamara <[email protected]>; Ian Betts <[email protected]>; Tomasz Kulasek <[email protected]>
Cc: [email protected]; NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]; [email protected]; Jerin Jacob <[email protected]>; Ali Alnubani <[email protected]>
Subject: [PATCH] examples/performance-thread: fix build issue with clang 12.0.1From: Jerin Jacob <[email protected]>
In clang 12.0.1 version, the use of
pthread_yield()deprecated, usesched_yield()instead.log:
Compiling C object
examples/dpdk-pthread_shim.p/performance- thread_pthread_shim_main.c.o../examples/performance-thread/pthread_shim/main.c: In function 'helloworld_pthread':../examples/performance-thread/pthread_shim/main.c:75:9: warning:
'pthread_yield' is deprecated:pthread_yieldis deprecated, usesched_yieldinstead [-Wdeprecated-declarations]Fixes 433ba6228f9a ("examples/performance-thread: add pthread_shim
Quoted 8 lines
app")
Bugzilla ID: 745
Signed-off-by Jerin Jacob <[email protected]>---
I think this issue might be specific to Fedora Rawhide's build of clang 12.0.1, see my comment in the ticket:
https://bugs.dpdk.org/show_bug.cgi?id=745#c3
Thanks Jerin.
Ali
Thomas Monjalon
Applied19/08/2021 09:09, Ali Alnubani:
Quoted 17 lines
From: [email protected] <[email protected]>
Quoted 16 lines
In clang 12.0.1 version, the use of
pthread_yield()deprecated, usesched_yield()instead.log:
Compiling C object
examples/dpdk-pthread_shim.p/performance- thread_pthread_shim_main.c.o../examples/performance-thread/pthread_shim/main.c: In function 'helloworld_pthread':../examples/performance-thread/pthread_shim/main.c:75:9: warning:
'pthread_yield' is deprecated:pthread_yieldis deprecated, usesched_yieldinstead [-Wdeprecated-declarations]Fixes 433ba6228f9a ("examples/performance-thread: add pthread_shimapp")
adding Cc: stable for other branches.
Quoted 10 lines
Quoted 7 lines
Bugzilla ID: 745
Signed-off-by Jerin Jacob <[email protected]>---
I think this issue might be specific to Fedora Rawhide's build of clang 12.0.1, see my comment in the ticket:
https://bugs.dpdk.org/show_bug.cgi?id=745#c3
I hit the same issue on Arch Linux.
Quoted 3 lines
Tested-by Ali Alnubani <[email protected]>Thanks Jerin.
Applied, thanks.