| 332 | // |
| 333 | |
| 334 | void |
| 335 | EThread::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 | |
| 372 | EThread::Metrics::Slice & |
| 373 | EThread::Metrics::Slice::operator+=(Slice const &that) |