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

Function test_thread_create_join

dpdk/app/test/test_threads.c:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30static int
31test_thread_create_join(void)
32{
33 rte_thread_t thread_id;
34 rte_thread_t thread_main_id;
35
36 thread_id_ready = 0;
37 RTE_TEST_ASSERT(rte_thread_create(&thread_id, NULL, thread_main, &thread_main_id) == 0,
38 "Failed to create thread.");
39
40 while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
41 ;
42
43 RTE_TEST_ASSERT(rte_thread_equal(thread_id, thread_main_id) != 0,
44 "Unexpected thread id.");
45
46 __atomic_store_n(&thread_id_ready, 2, __ATOMIC_RELEASE);
47
48 RTE_TEST_ASSERT(rte_thread_join(thread_id, NULL) == 0,
49 "Failed to join thread.");
50
51 return 0;
52}
53
54static int
55test_thread_create_detach(void)

Callers

nothing calls this directly

Calls 3

rte_thread_createFunction · 0.50
rte_thread_equalFunction · 0.50
rte_thread_joinFunction · 0.50

Tested by

no test coverage detected