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

Function stack_thread_push_pop

dpdk/app/test/test_stack.c:279–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277static struct test_args thread_test_args;
278
279static int
280stack_thread_push_pop(__rte_unused void *args)
281{
282 void *obj_table[MAX_BULK];
283 int i;
284
285 for (i = 0; i < NUM_ITERS_PER_THREAD; i++) {
286 unsigned int num;
287
288 num = rte_rand() % MAX_BULK;
289
290 if (rte_stack_push(thread_test_args.s, obj_table, num) != num) {
291 printf("[%s():%u] Failed to push %u pointers\n",
292 __func__, __LINE__, num);
293 return -1;
294 }
295
296 if (rte_stack_pop(thread_test_args.s, obj_table, num) != num) {
297 printf("[%s():%u] Failed to pop %u pointers\n",
298 __func__, __LINE__, num);
299 return -1;
300 }
301 }
302
303 return 0;
304}
305
306static int
307test_stack_multithreaded(uint32_t flags)

Callers

nothing calls this directly

Calls 4

rte_randFunction · 0.85
rte_stack_pushFunction · 0.85
rte_stack_popFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected