MCPcopy Create free account
hub / github.com/apache/trafficserver / ink_atomiclist_pop

Function ink_atomiclist_pop

src/tscore/ink_queue.cc:524–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522}
523
524void *
525ink_atomiclist_pop(InkAtomicList *l)
526{
527 head_p item;
528 head_p next;
529 int result = 0;
530 do {
531 INK_QUEUE_LD(item, l->head);
532 if (TO_PTR(FREELIST_POINTER(item)) == nullptr) {
533 return nullptr;
534 }
535 SET_FREELIST_POINTER_VERSION(next, *ADDRESS_OF_NEXT(TO_PTR(FREELIST_POINTER(item)), l->offset), FREELIST_VERSION(item) + 1);
536 result = ink_atomic_cas(&l->head.data, item.data, next.data);
537 } while (result == 0);
538 {
539 void *ret = TO_PTR(FREELIST_POINTER(item));
540 *ADDRESS_OF_NEXT(ret, l->offset) = nullptr;
541 return ret;
542 }
543}
544
545void *
546ink_atomiclist_popall(InkAtomicList *l)

Callers 2

testalistFunction · 0.85
popMethod · 0.85

Calls 1

ink_atomic_casFunction · 0.85

Tested by 1

testalistFunction · 0.68