[PATCH v2 6/6] test/threads: remove unit test use of pthread
Tyler Retzlaff
roretzla at linux.microsoft.com
Wed Jun 15 01:47:18 CEST 2022
now that rte_thread provides thread lifetime functions stop using
pthread in unit tests.
Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
app/test/test_threads.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/app/test/test_threads.c b/app/test/test_threads.c
index 92a149a..034f82d 100644
--- a/app/test/test_threads.c
+++ b/app/test/test_threads.c
@@ -3,7 +3,6 @@
*/
#include <string.h>
-#include <pthread.h>
#include <rte_thread.h>
#include <rte_debug.h>
@@ -79,12 +78,11 @@
static int
test_thread_priority(void)
{
- pthread_t id;
rte_thread_t thread_id;
enum rte_thread_priority priority;
thread_id_ready = 0;
- RTE_TEST_ASSERT(pthread_create(&id, NULL, thread_main, &thread_id) == 0,
+ RTE_TEST_ASSERT(rte_thread_create(&thread_id, NULL, thread_main, NULL) == 0,
"Failed to create thread");
while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
@@ -131,13 +129,12 @@
static int
test_thread_affinity(void)
{
- pthread_t id;
rte_thread_t thread_id;
rte_cpuset_t cpuset0;
rte_cpuset_t cpuset1;
thread_id_ready = 0;
- RTE_TEST_ASSERT(pthread_create(&id, NULL, thread_main, &thread_id) == 0,
+ RTE_TEST_ASSERT(rte_thread_create(&thread_id, NULL, thread_main, NULL) == 0,
"Failed to create thread");
while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
--
1.8.3.1
More information about the dev
mailing list