Skip to content

Commit a2dee0c

Browse files
committed
added more code comments to the timer implementation.
1 parent af2d357 commit a2dee0c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ngx_http_lua_timer.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ ngx_http_lua_abort_pending_timers(ngx_event_t *ev)
487487
prev, cur, cur->parent, cur->left, cur->right);
488488

489489
if (prev == cur->parent) {
490+
/* neither of the children has been accessed yet */
491+
490492
next = cur->left;
491493
if (next == sentinel) {
492494
ev = (ngx_event_t *)
@@ -501,6 +503,8 @@ ngx_http_lua_abort_pending_timers(ngx_event_t *ev)
501503
}
502504

503505
} else if (prev == cur->left) {
506+
/* just accessed the left child */
507+
504508
ev = (ngx_event_t *)
505509
((char *) cur - offsetof(ngx_event_t, timer));
506510

@@ -512,9 +516,11 @@ ngx_http_lua_abort_pending_timers(ngx_event_t *ev)
512516
next = (cur->right != sentinel) ? cur->right : cur->parent;
513517

514518
} else if (prev == cur->right) {
519+
/* already accessed both children */
515520
next = cur->parent;
516521

517522
} else {
523+
/* not reacheable */
518524
next = NULL;
519525
}
520526

0 commit comments

Comments
 (0)