- int32_t diff;
- diff = timer_diff(listp->runtime, 0, tcp_now, offset);
- if (diff <= 0) {
- /* The list is going to run before this timer */
- goto done;
+ /*
+ * The list could have got scheduled while this
+ * thread was waiting for the lock
+ */
+ if (listp->scheduled) {
+ int32_t diff;
+ diff = timer_diff(listp->runtime, 0,
+ tcp_now, offset);
+ if (diff <= 0)
+ goto done;
+ else
+ goto schedule;