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
/
pthread_shim.c
diff --git
a/examples/performance-thread/pthread_shim/pthread_shim.c
b/examples/performance-thread/pthread_shim/pthread_shim.c
index
0d6100c
..
7167311
100644
(file)
--- a/
examples/performance-thread/pthread_shim/pthread_shim.c
+++ b/
examples/performance-thread/pthread_shim/pthread_shim.c
@@
-159,7
+159,7
@@
int (*f_pthread_setschedparam)
int (*f_pthread_yield)
(void);
int (*f_pthread_setaffinity_np)
int (*f_pthread_yield)
(void);
int (*f_pthread_setaffinity_np)
- (pthread_t thread, size_t cpusetsize, const
cpu_
set_t *cpuset);
+ (pthread_t thread, size_t cpusetsize, const
rte_cpu
set_t *cpuset);
int (*f_nanosleep)
(const struct timespec *req, struct timespec *rem);
} _sys_pthread_funcs = {
int (*f_nanosleep)
(const struct timespec *req, struct timespec *rem);
} _sys_pthread_funcs = {
@@
-390,11
+390,11
@@
pthread_create(pthread_t *__restrict tid,
if (attr != NULL) {
/* determine CPU being requested */
if (attr != NULL) {
/* determine CPU being requested */
-
cpu_
set_t cpuset;
+
rte_cpu
set_t cpuset;
CPU_ZERO(&cpuset);
pthread_attr_getaffinity_np(attr,
CPU_ZERO(&cpuset);
pthread_attr_getaffinity_np(attr,
- sizeof(
cpu_
set_t),
+ sizeof(
rte_cpu
set_t),
&cpuset);
if (CPU_COUNT(&cpuset) != 1)
&cpuset);
if (CPU_COUNT(&cpuset) != 1)
@@
-576,15
+576,26
@@
int pthread_rwlock_wrlock(pthread_rwlock_t *a)
return _sys_pthread_funcs.f_pthread_rwlock_wrlock(a);
}
return _sys_pthread_funcs.f_pthread_rwlock_wrlock(a);
}
-int pthread_yield(void)
+#ifdef RTE_EXEC_ENV_LINUXAPP
+int
+pthread_yield(void)
{
if (override) {
lthread_yield();
return 0;
}
return _sys_pthread_funcs.f_pthread_yield();
{
if (override) {
lthread_yield();
return 0;
}
return _sys_pthread_funcs.f_pthread_yield();
-
}
}
+#else
+void
+pthread_yield(void)
+{
+ if (override)
+ lthread_yield();
+ else
+ _sys_pthread_funcs.f_pthread_yield();
+}
+#endif
pthread_t pthread_self(void)
{
pthread_t pthread_self(void)
{
@@
-686,7
+697,7
@@
int nanosleep(const struct timespec *req, struct timespec *rem)
int
pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
int
pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
- const
cpu_
set_t *cpuset)
+ const
rte_cpu
set_t *cpuset)
{
if (override) {
/* we only allow affinity with a single CPU */
{
if (override) {
/* we only allow affinity with a single CPU */