mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-18 13:36:41 +02:00
MINOR: queue: add queue_init() to initialize a queue
This is better and cleaner than open-coding this in the server and proxy code, where it has all chances of becoming wrong once forgotten.
This commit is contained in:
@@ -109,6 +109,13 @@ static inline int queue_limit_offset(int offset)
|
||||
return offset;
|
||||
}
|
||||
|
||||
static inline void queue_init(struct queue *queue)
|
||||
{
|
||||
queue->head = EB_ROOT;
|
||||
queue->length = 0;
|
||||
queue->idx = 0;
|
||||
HA_SPIN_INIT(&queue->lock);
|
||||
}
|
||||
|
||||
#endif /* _HAPROXY_QUEUE_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user