| 353 | } |
| 354 | |
| 355 | static int |
| 356 | test_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 | |
| 381 | static int |
| 382 | test_lcores(void) |
no test coverage detected