| 243 | |
| 244 | template <class T, class List> |
| 245 | inline int |
| 246 | ActivityCop<T, List>::check_activity(int /* event */, Event *e) |
| 247 | { |
| 248 | ink_hrtime now = ink_get_hrtime(); |
| 249 | |
| 250 | // Traverse list & check inactivity or activity |
| 251 | T *t = _list->head; |
| 252 | while (t) { |
| 253 | T *next = _list->next(t); |
| 254 | if (t->mutex == nullptr) { |
| 255 | t = next; |
| 256 | continue; |
| 257 | } |
| 258 | |
| 259 | MUTEX_TRY_LOCK(lock, t->mutex, this_ethread()); |
| 260 | if (!lock.is_locked()) { |
| 261 | t = next; |
| 262 | continue; |
| 263 | } |
| 264 | |
| 265 | if (t->is_inactive_timeout_expired(now)) { |
| 266 | t->handleEvent(VC_EVENT_INACTIVITY_TIMEOUT, e); |
| 267 | } else if (t->is_active_timeout_expired(now)) { |
| 268 | t->handleEvent(VC_EVENT_ACTIVE_TIMEOUT, e); |
| 269 | } |
| 270 | |
| 271 | t = next; |
| 272 | } |
| 273 | |
| 274 | return EVENT_DONE; |
| 275 | } |
nothing calls this directly
no test coverage detected