| 102 | } |
| 103 | |
| 104 | void |
| 105 | cycle_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 |
nothing calls this directly
no test coverage detected