Skip to content

Commit

Permalink
examples/performance-thread: fix build with clang 12.0.1
Browse files Browse the repository at this point in the history
[ upstream commit 5e184c4 ]

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: 433ba62 ("examples/performance-thread: add pthread_shim app")

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
  • Loading branch information
jerinjacobk authored and cpaelzer committed Nov 29, 2021
1 parent 910f2fa commit eec17bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/performance-thread/pthread_shim/main.c
Expand Up @@ -71,7 +71,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);
Expand Down

0 comments on commit eec17bc

Please sign in to comment.