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

Method execute

src/iocore/eventsystem/UnixEThread.cc:334–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332//
333
334void
335EThread::execute()
336{
337 // Do the start event first.
338 // coverity[lock]
339 if (start_event) {
340 {
341 SCOPED_MUTEX_LOCK(lock, start_event->mutex, this);
342 start_event->continuation->handleEvent(EVENT_IMMEDIATE, start_event);
343 }
344 free_event(start_event);
345 start_event = nullptr;
346 }
347
348 switch (tt) {
349 case REGULAR: {
350 /* The Event Thread has two status: busy and sleep:
351 * - Keep `EThread::lock` locked while Event Thread is busy,
352 * - The `EThread::lock` is released while Event Thread is sleep.
353 * When other threads try to acquire the `EThread::lock` of the target Event Thread:
354 * - Acquired, indicating that the target Event Thread is sleep,
355 * - Failed, indicating that the target Event Thread is busy.
356 */
357 ink_mutex_acquire(&EventQueueExternal.lock);
358 this->execute_regular();
359 ink_mutex_release(&EventQueueExternal.lock);
360 break;
361 }
362 case DEDICATED: {
363 break;
364 }
365 default:
366 ink_assert(!"bad case value (execute)");
367 break;
368 } /* End switch */
369 // coverity[missing_unlock]
370}
371
372EThread::Metrics::Slice &
373EThread::Metrics::Slice::operator+=(Slice const &that)

Calls 4

execute_regularMethod · 0.95
ink_mutex_acquireFunction · 0.85
ink_mutex_releaseFunction · 0.85
handleEventMethod · 0.45

Tested by 4

mainFunction · 0.36
mainFunction · 0.36
udp_echo_serverFunction · 0.36
mainFunction · 0.36