[dpdk-dev] [PATCH v2 5/6] examples/performance-thread: replace restrict with wrapper

Joyce Kong joyce.kong at arm.com
Mon Jul 6 09:49:29 CEST 2020


'__rte_restrict' is a common wrapper for restricted pointers which
can be supported by all compilers. Use '__rte_restrict' instead of
'__restrict' for code consistency.

Signed-off-by: Joyce Kong <joyce.kong at arm.com>
---
 .../performance-thread/pthread_shim/pthread_shim.c   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c
index 93e8dca3f..bbc076584 100644
--- a/examples/performance-thread/pthread_shim/pthread_shim.c
+++ b/examples/performance-thread/pthread_shim/pthread_shim.c
@@ -341,9 +341,9 @@ int pthread_cond_signal(pthread_cond_t *cond)
 }
 
 int
-pthread_cond_timedwait(pthread_cond_t *__restrict cond,
-		       pthread_mutex_t *__restrict mutex,
-		       const struct timespec *__restrict time)
+pthread_cond_timedwait(pthread_cond_t *__rte_restrict cond,
+		       pthread_mutex_t *__rte_restrict mutex,
+		       const struct timespec *__rte_restrict time)
 {
 	NOT_IMPLEMENTED;
 	return _sys_pthread_funcs.f_pthread_cond_timedwait(cond, mutex, time);
@@ -362,10 +362,10 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 }
 
 int
-pthread_create(pthread_t *__restrict tid,
-		const pthread_attr_t *__restrict attr,
+pthread_create(pthread_t *__rte_restrict tid,
+		const pthread_attr_t *__rte_restrict attr,
 		lthread_func_t func,
-	       void *__restrict arg)
+	       void *__rte_restrict arg)
 {
 	if (override) {
 		int lcore = -1;
-- 
2.27.0



More information about the dev mailing list