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

Function ink_atomiclist_push

src/tscore/ink_queue.cc:572–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572void *
573ink_atomiclist_push(InkAtomicList *l, void *item)
574{
575 void **adr_of_next = ADDRESS_OF_NEXT(item, l->offset);
576 head_p head;
577 head_p item_pair;
578 int result = 0;
579 void *h = nullptr;
580 do {
581 INK_QUEUE_LD(head, l->head);
582 h = FREELIST_POINTER(head);
583 *adr_of_next = h;
584 ink_assert(item != TO_PTR(h));
585 SET_FREELIST_POINTER_VERSION(item_pair, FROM_PTR(item), FREELIST_VERSION(head));
586 INK_MEMORY_BARRIER;
587 result = ink_atomic_cas(&l->head.data, head.data, item_pair.data);
588 } while (result == 0);
589
590 return TO_PTR(h);
591}
592
593void *
594ink_atomiclist_remove(InkAtomicList *l, void *item)

Callers 7

enqueueMethod · 0.85
testalistFunction · 0.85
init_dataFunction · 0.85
cycle_dataFunction · 0.85
pushMethod · 0.85

Calls 1

ink_atomic_casFunction · 0.85

Tested by 3

testalistFunction · 0.68
init_dataFunction · 0.68
cycle_dataFunction · 0.68