| 91 | } |
| 92 | |
| 93 | TS_INLINE Event * |
| 94 | EventProcessor::schedule(Event *e, EventType etype) |
| 95 | { |
| 96 | ink_assert(etype < MAX_EVENT_TYPES); |
| 97 | |
| 98 | if (TSSystemState::is_event_system_shut_down()) { |
| 99 | return nullptr; |
| 100 | } |
| 101 | |
| 102 | EThread *affinity_thread = e->continuation->getThreadAffinity(); |
| 103 | EThread *curr_thread = this_ethread(); |
| 104 | if (affinity_thread != nullptr && affinity_thread->is_event_type(etype)) { |
| 105 | e->ethread = affinity_thread; |
| 106 | } else { |
| 107 | // Is the current thread eligible? |
| 108 | if (curr_thread != nullptr && curr_thread->is_event_type(etype)) { |
| 109 | e->ethread = curr_thread; |
| 110 | } else { |
| 111 | e->ethread = assign_thread(etype); |
| 112 | } |
| 113 | if (affinity_thread == nullptr) { |
| 114 | e->continuation->setThreadAffinity(e->ethread); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | if (e->continuation->mutex) { |
| 119 | e->mutex = e->continuation->mutex; |
| 120 | } |
| 121 | |
| 122 | if (curr_thread != nullptr && e->ethread == curr_thread) { |
| 123 | e->ethread->EventQueueExternal.enqueue_local(e); |
| 124 | } else { |
| 125 | e->ethread->EventQueueExternal.enqueue(e); |
| 126 | } |
| 127 | |
| 128 | return e; |
| 129 | } |
| 130 | |
| 131 | TS_INLINE Event * |
| 132 | EventProcessor::schedule_imm(Continuation *cont, EventType et, int callback_event, void *cookie) |
nothing calls this directly
no test coverage detected