int
rte_eal_wait_lcore(unsigned worker_id)
{
- if (lcore_config[worker_id].state == WAIT)
- return 0;
-
- while (lcore_config[worker_id].state != WAIT &&
- lcore_config[worker_id].state != FINISHED)
+ while (__atomic_load_n(&lcore_config[worker_id].state,
+ __ATOMIC_ACQUIRE) != WAIT)
rte_pause();
- rte_rmb();
-
- /* we are in finished state, go to wait state */
- lcore_config[worker_id].state = WAIT;
return lcore_config[worker_id].ret;
}
if (call_main == CALL_MAIN) {
lcore_config[main_lcore].ret = f(arg);
- lcore_config[main_lcore].state = FINISHED;
+ lcore_config[main_lcore].state = WAIT;
}
return 0;