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

Method schedule_entire

src/iocore/eventsystem/P_UnixEventProcessor.h:204–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204TS_INLINE std::vector<TSAction>
205EventProcessor::schedule_entire(Continuation *cont, ink_hrtime t, ink_hrtime p, EventType et, int callback_event, void *cookie)
206{
207 ThreadGroupDescriptor *tg = &thread_group[et];
208 EThread *curr_thread = this_ethread();
209
210 std::vector<TSAction> actions;
211
212 for (int i = 0; i < tg->_count; i++) {
213 Event *e = eventAllocator.alloc();
214
215 e->ethread = tg->_thread[i];
216 e->callback_event = callback_event;
217 e->cookie = cookie;
218
219 if (t == 0 && p == 0) {
220 e->init(cont, 0, 0);
221 } else if (t != 0 && p == 0) {
222 e->init(cont, ink_get_hrtime() + t, 0);
223 } else if (t == 0 && p != 0) {
224 if (p < 0) {
225 e->init(cont, p, p);
226 } else {
227 e->init(cont, ink_get_hrtime() + p, p);
228 }
229 } else {
230 ink_assert(!"not reached");
231 }
232
233 e->mutex = new_ProxyMutex();
234
235 if (curr_thread != nullptr && e->ethread == curr_thread) {
236 e->ethread->EventQueueExternal.enqueue_local(e);
237 } else {
238 e->ethread->EventQueueExternal.enqueue(e);
239 }
240
241 /* This is a hack. Should be handled in ink_types */
242 actions.push_back((TSAction)((uintptr_t) reinterpret_cast<TSAction>(e) | 0x1));
243 }
244
245 return actions;
246}

Callers 2

Calls 8

this_ethreadFunction · 0.85
ink_get_hrtimeFunction · 0.85
new_ProxyMutexFunction · 0.85
enqueue_localMethod · 0.80
allocMethod · 0.45
initMethod · 0.45
enqueueMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected