git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
examples/performance-thread: fix build on FreeBSD
[dpdk.git]
/
examples
/
performance-thread
/
pthread_shim
/
main.c
diff --git
a/examples/performance-thread/pthread_shim/main.c
b/examples/performance-thread/pthread_shim/main.c
index
f035721
..
850b009
100644
(file)
--- a/
examples/performance-thread/pthread_shim/main.c
+++ b/
examples/performance-thread/pthread_shim/main.c
@@
-59,6
+59,10
@@
#define DEBUG_APP 0
#define HELLOW_WORLD_MAX_LTHREADS 10
#define DEBUG_APP 0
#define HELLOW_WORLD_MAX_LTHREADS 10
+#ifndef __GLIBC__ /* sched_getcpu() is glibc-specific */
+#define sched_getcpu() rte_lcore_id()
+#endif
+
__thread int print_count;
__thread pthread_mutex_t print_lock;
__thread int print_count;
__thread pthread_mutex_t print_lock;
@@
-175,12
+179,12
@@
static void initial_lthread(void *args __attribute__((unused)))
* use an attribute to pass the desired lcore
*/
pthread_attr_t attr;
* use an attribute to pass the desired lcore
*/
pthread_attr_t attr;
-
cpu_
set_t cpuset;
+
rte_cpu
set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(lcore, &cpuset);
pthread_attr_init(&attr);
CPU_ZERO(&cpuset);
CPU_SET(lcore, &cpuset);
pthread_attr_init(&attr);
- pthread_attr_setaffinity_np(&attr, sizeof(
cpu_
set_t), &cpuset);
+ pthread_attr_setaffinity_np(&attr, sizeof(
rte_cpu
set_t), &cpuset);
/* create the thread */
pthread_create(&tid[i], &attr, helloworld_pthread, (void *) i);
/* create the thread */
pthread_create(&tid[i], &attr, helloworld_pthread, (void *) i);