mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
CLEANUP: hlua_fcn/queue: make queue:push() easier to read
Adding some spaces and code comments in queue:push() function to make it easier to read.
This commit is contained in:
parent
c0af7cdba2
commit
d7d507aa8a
@ -564,12 +564,18 @@ static int hlua_queue_push(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
BUG_ON(!queue);
|
BUG_ON(!queue);
|
||||||
|
|
||||||
item = pool_alloc(pool_head_hlua_queue);
|
item = pool_alloc(pool_head_hlua_queue);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
/* memory error */
|
||||||
lua_pushboolean(L, 0);
|
lua_pushboolean(L, 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get a reference from lua object at the top of the stack */
|
||||||
item->ref = hlua_ref(L);
|
item->ref = hlua_ref(L);
|
||||||
|
|
||||||
|
/* push new entry to the queue */
|
||||||
MT_LIST_INIT(&item->list);
|
MT_LIST_INIT(&item->list);
|
||||||
HA_ATOMIC_INC(&queue->size);
|
HA_ATOMIC_INC(&queue->size);
|
||||||
MT_LIST_APPEND(&queue->list, &item->list);
|
MT_LIST_APPEND(&queue->list, &item->list);
|
||||||
|
Loading…
Reference in New Issue
Block a user