diff options
Diffstat (limited to 'examples/performance-thread/pthread_shim')
-rw-r--r-- | examples/performance-thread/pthread_shim/main.c | 6 | ||||
-rw-r--r-- | examples/performance-thread/pthread_shim/pthread_shim.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c index 850b009d..febae39b 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 diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c index 113bafa0..bc7cf2b0 100644 --- a/examples/performance-thread/pthread_shim/pthread_shim.c +++ b/examples/performance-thread/pthread_shim/pthread_shim.c @@ -202,10 +202,7 @@ static void *__libc_dl_handle = RTLD_NEXT; * The constructor function initialises the * function pointers for pthread library functions */ -void -pthread_intercept_ctor(void)__attribute__((constructor)); -void -pthread_intercept_ctor(void) +RTE_INIT(pthread_intercept_ctor) { override = 0; /* |