Lines Matching full:timeout
41 struct eloop_timeout *timeout;
116 struct eloop_timeout *timeout, *tmp, *prev;
118 timeout = (struct eloop_timeout *) malloc(sizeof(*timeout));
119 if (timeout == NULL)
121 os_get_time(&timeout->time);
122 timeout->time.sec += secs;
123 timeout->time.usec += usecs;
124 while (timeout->time.usec >= 1000000) {
125 timeout->time.sec++;
126 timeout->time.usec -= 1000000;
128 timeout->eloop_data = eloop_data;
129 timeout->user_data = user_data;
130 timeout->handler = handler;
131 timeout->next = NULL;
133 if (eloop.timeout == NULL) {
134 eloop.timeout = timeout;
139 tmp = eloop.timeout;
141 if (os_time_before(&timeout->time, &tmp->time))
148 timeout->next = eloop.timeout;
149 eloop.timeout = timeout;
151 timeout->next = prev->next;
152 prev->next = timeout;
162 struct eloop_timeout *timeout, *prev, *next;
166 timeout = eloop.timeout;
167 while (timeout != NULL) {
168 next = timeout->next;
170 if (timeout->handler == handler &&
171 (timeout->eloop_data == eloop_data ||
173 (timeout->user_data == user_data ||
176 eloop.timeout = next;
179 free(timeout);
182 prev = timeout;
184 timeout = next;
197 tmp = eloop.timeout;
311 (eloop.timeout || eloop.reader_count > 0)) {
312 if (eloop.timeout) {
314 if (os_time_before(&now, &eloop.timeout->time))
315 os_time_sub(&eloop.timeout->time, &now, &tv);
321 * TODO: wait for any event (read socket ready, timeout (tv),
329 if (eloop.timeout) {
333 if (!os_time_before(&now, &eloop.timeout->time)) {
334 tmp = eloop.timeout;
335 eloop.timeout = eloop.timeout->next;
370 struct eloop_timeout *timeout, *prev;
372 timeout = eloop.timeout;
373 while (timeout != NULL) {
374 prev = timeout;
375 timeout = timeout->next;