| 101 | } |
| 102 | |
| 103 | void |
| 104 | INKContInternal::destroy() |
| 105 | { |
| 106 | if (m_free_magic == INKCONT_INTERN_MAGIC_DEAD) { |
| 107 | ink_release_assert(!"Plugin tries to use a continuation which is deleted"); |
| 108 | } |
| 109 | m_deleted = 1; |
| 110 | if (m_deletable) { |
| 111 | this->free(); |
| 112 | } else { |
| 113 | // TODO: Should this schedule on some other "thread" ? |
| 114 | // TODO: we don't care about the return action? |
| 115 | if (ink_atomic_increment((int *)&m_event_count, 1) < 0) { |
| 116 | ink_assert(!"not reached"); |
| 117 | } |
| 118 | EThread *p = this_ethread(); |
| 119 | |
| 120 | // If this_thread() returns null, the EThread object for the current thread has been destroyed (or it never existed). |
| 121 | // Presumably this will only happen during destruction of statically-initialized objects at TS shutdown, so no further |
| 122 | // action is needed. |
| 123 | // |
| 124 | if (p) { |
| 125 | p->schedule_imm(this); |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | void |
| 131 | INKContInternal::handle_event_count(int event) |