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

Function test_ctrl_thread

dpdk/app/test/test_lcores.c:355–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355static int
356test_ctrl_thread(void)
357{
358 struct thread_context ctrl_thread_context;
359 struct thread_context *t;
360
361 /* Create one control thread */
362 t = &ctrl_thread_context;
363 t->state = Thread_INIT;
364 if (rte_thread_create_control(&t->id, "dpdk-test-ctrlt",
365 ctrl_thread_loop, t) != 0)
366 return -1;
367
368 /* Wait till the control thread exits.
369 * This also acts as the barrier such that the memory operations
370 * in control thread are visible to this thread.
371 */
372 rte_thread_join(t->id, NULL);
373
374 /* Check if the control thread set the correct state */
375 if (t->state != Thread_DONE)
376 return -1;
377
378 return 0;
379}
380
381static int
382test_lcores(void)

Callers 1

test_lcoresFunction · 0.85

Calls 2

rte_thread_joinFunction · 0.50

Tested by

no test coverage detected