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

Function cycle_data

src/tscore/test_atomic.cc:104–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void
105cycle_data(void *d)
106{
107 InkAtomicList *l;
108 struct listItem *pli;
109 struct listItem *pli_next;
110 int iterations;
111 int me;
112
113 me = (int)d;
114 iterations = 0;
115
116 while (1) {
117 l = &alists[(me + rand()) % MAX_ATOMIC_LISTS];
118
119 pli = (struct listItem *)ink_atomiclist_popall(l);
120 if (!pli)
121 continue;
122
123 // Place listItems into random queues
124 while (pli) {
125 ink_assert((pli->data1 ^ pli->data2 ^ pli->data3 ^ pli->data4) == pli->check);
126 pli_next = (struct listItem *)pli->link;
127 pli->link = 0;
128 ink_atomiclist_push(&alists[(me + rand()) % MAX_ATOMIC_LISTS], (void *)pli);
129 pli = pli_next;
130 }
131 iterations++;
132 poll(0, 0, 10); // 10 msec delay
133 if ((iterations % 100) == 0)
134 printf("%d ", me);
135 }
136}
137
138/************************************************************************/
139#endif // LONG_ATOMICLIST_TEST

Callers

nothing calls this directly

Calls 2

ink_atomiclist_popallFunction · 0.85
ink_atomiclist_pushFunction · 0.85

Tested by

no test coverage detected