MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_thread_create_detach

Function test_thread_create_detach

dpdk/app/test/test_threads.c:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54static int
55test_thread_create_detach(void)
56{
57 rte_thread_t thread_id;
58 rte_thread_t thread_main_id;
59
60 thread_id_ready = 0;
61 RTE_TEST_ASSERT(rte_thread_create(&thread_id, NULL, thread_main,
62 &thread_main_id) == 0, "Failed to create thread.");
63
64 while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
65 ;
66
67 RTE_TEST_ASSERT(rte_thread_equal(thread_id, thread_main_id) != 0,
68 "Unexpected thread id.");
69
70 __atomic_store_n(&thread_id_ready, 2, __ATOMIC_RELEASE);
71
72 RTE_TEST_ASSERT(rte_thread_detach(thread_id) == 0,
73 "Failed to detach thread.");
74
75 return 0;
76}
77
78static int
79test_thread_priority(void)

Callers

nothing calls this directly

Calls 3

rte_thread_createFunction · 0.50
rte_thread_equalFunction · 0.50
rte_thread_detachFunction · 0.50

Tested by

no test coverage detected