~ubuntu-branches/ubuntu/trusty/haproxy/trusty

« back to all changes in this revision

Viewing changes to src/task.c

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2009-10-19 22:31:45 UTC
  • mfrom: (1.1.7 upstream) (2.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091019223145-259fs24dejjixo1f
New upstream bugfix release

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
                return;
109
109
        }
110
110
        eb32_insert(&timers, &task->wq);
111
 
        if (!last_timer || (task->wq.node.bit < last_timer->node.bit))
 
111
 
 
112
        /* Make sure we don't assign the last_timer to a node-less entry */
 
113
        if (task->wq.node.node_p && (!last_timer || (task->wq.node.bit < last_timer->node.bit)))
112
114
                last_timer = &task->wq;
113
115
        return;
114
116
}
152
154
                 * lot cheaper to proceed like this because we almost never update
153
155
                 * the tree. We may also find disabled expiration dates there. Since
154
156
                 * we have detached the task from the tree, we simply call task_queue
155
 
                 * to take care of this.
 
157
                 * to take care of this. Note that we might occasionally requeue it at
 
158
                 * the same place, before <eb>, so we have to check if this happens,
 
159
                 * and adjust <eb>, otherwise we may skip it which is not what we want.
 
160
                 * We may also not requeue the task (and not point eb at it) if its
 
161
                 * expiration time is not set.
156
162
                 */
157
163
                if (!tick_is_expired(task->expire, now_ms)) {
158
 
                        task_queue(task);
 
164
                        if (!tick_isset(task->expire))
 
165
                                continue;
 
166
                        __task_queue(task);
 
167
                        if (!eb || eb->key > task->wq.key)
 
168
                                eb = &task->wq;
159
169
                        continue;
160
170
                }
161
171
                task_wakeup(task, TASK_WOKEN_TIMER);