diff options
author | Jacek Piasecki <jacekx.piasecki@intel.com> | 2017-10-12 13:44:44 +0200 |
---|---|---|
committer | Thomas Monjalon <thomas@monjalon.net> | 2017-10-14 01:22:23 +0200 |
commit | 842ee032e41e678568ffbce29172b346dc09c82b (patch) | |
tree | 1f1dfd55ba2adb787cb582d3efb931872a9e09b9 | |
parent | b325a66a4625ffa682d78d61a339e7df08eddcd8 (diff) | |
download | dpdk-842ee032e41e678568ffbce29172b346dc09c82b.zip dpdk-842ee032e41e678568ffbce29172b346dc09c82b.tar.gz dpdk-842ee032e41e678568ffbce29172b346dc09c82b.tar.xz |
examples/performance-thread: check thread creation
There was a call for thread create function without result check.
Added result check and message printout after failure.
Coverity issue: 143441
Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim app")
Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
-rw-r--r-- | examples/performance-thread/pthread_shim/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c index 850b009..febae39 100644 --- a/examples/performance-thread/pthread_shim/main.c +++ b/examples/performance-thread/pthread_shim/main.c @@ -161,6 +161,7 @@ static void initial_lthread(void *args __attribute__((unused))) pthread_override_set(1); uint64_t i; + int ret; /* initialize mutex for shared counter */ print_count = 0; @@ -187,7 +188,10 @@ static void initial_lthread(void *args __attribute__((unused))) pthread_attr_setaffinity_np(&attr, sizeof(rte_cpuset_t), &cpuset); /* create the thread */ - pthread_create(&tid[i], &attr, helloworld_pthread, (void *) i); + ret = pthread_create(&tid[i], &attr, + helloworld_pthread, (void *) i); + if (ret != 0) + rte_exit(EXIT_FAILURE, "Cannot create helloworld thread\n"); } /* wait for 1s to allow threads |