examples/performance-thread: fix build with clang 12.0.1
authorJerin Jacob <jerinj@marvell.com>
Mon, 16 Aug 2021 13:19:14 +0000 (18:49 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 27 Aug 2021 11:40:23 +0000 (13:40 +0200)
In clang 12.0.1 version, the use of pthread_yield() is deprecated,
use sched_yield() instead.

log:
    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
Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim app")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
examples/performance-thread/pthread_shim/main.c

index 257de50..7ce6cfb 100644 (file)
@@ -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);