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

Function test_thread_control_create_join

dpdk/app/test/test_threads.c:235–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235static int
236test_thread_control_create_join(void)
237{
238 rte_thread_t thread_id;
239 rte_thread_t thread_main_id;
240
241 thread_id_ready = 0;
242 RTE_TEST_ASSERT(rte_thread_create_control(&thread_id, "dpdk-test-thcc",
243 thread_main, &thread_main_id) == 0,
244 "Failed to create thread.");
245
246 while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
247 ;
248
249 RTE_TEST_ASSERT(rte_thread_equal(thread_id, thread_main_id) != 0,
250 "Unexpected thread id.");
251
252 __atomic_store_n(&thread_id_ready, 2, __ATOMIC_RELEASE);
253
254 RTE_TEST_ASSERT(rte_thread_join(thread_id, NULL) == 0,
255 "Failed to join thread.");
256
257 return 0;
258}
259
260static struct unit_test_suite threads_test_suite = {
261 .suite_name = "threads autotest",

Callers

nothing calls this directly

Calls 3

rte_thread_equalFunction · 0.50
rte_thread_joinFunction · 0.50

Tested by

no test coverage detected