+void *el_loop(void *data)
+{
+ time_t sec = time(NULL);
+
+ for (;;) {
+ struct timeval now;
+
+ el_dispatch(100);
+ pthread_testcancel();
+
+ gettimeofday(&now, NULL);
+ if (sec >= now.tv_sec)
+ continue;
+ sec = now.tv_sec;
+ now.tv_sec -= 10;
+ for (int i = jobs.len - 1; i >= 0; --i) {
+ job_t *w = jobs.arr[i];
+ if (timercmp(&now, &w->mru, >))
+ IGNORE(w->m->on_event(w, EL_EVT_WAKEUP));
+ }
+ }
+}
+