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

Function test_thread_attributes_priority

dpdk/app/test/test_threads.c:206–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static int
207test_thread_attributes_priority(void)
208{
209 rte_thread_t thread_id;
210 rte_thread_attr_t attr;
211 enum rte_thread_priority priority;
212
213 RTE_TEST_ASSERT(rte_thread_attr_init(&attr) == 0,
214 "Failed to initialize thread attributes");
215 RTE_TEST_ASSERT(rte_thread_attr_set_priority(&attr, RTE_THREAD_PRIORITY_NORMAL) == 0,
216 "Failed to set thread attributes priority");
217
218 thread_id_ready = 0;
219 RTE_TEST_ASSERT(rte_thread_create(&thread_id, &attr, thread_main, NULL) == 0,
220 "Failed to create attributes priority thread.");
221
222 while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
223 ;
224
225 RTE_TEST_ASSERT(rte_thread_get_priority(thread_id, &priority) == 0,
226 "Failed to get thread priority");
227 RTE_TEST_ASSERT(priority == RTE_THREAD_PRIORITY_NORMAL,
228 "Failed to apply priority attributes");
229
230 __atomic_store_n(&thread_id_ready, 2, __ATOMIC_RELEASE);
231
232 return 0;
233}
234
235static int
236test_thread_control_create_join(void)

Callers

nothing calls this directly

Calls 4

rte_thread_attr_initFunction · 0.85
rte_thread_createFunction · 0.50
rte_thread_get_priorityFunction · 0.50

Tested by

no test coverage detected