The messages in this queue are in reverse chronological order, meaning
we push the incoming messages to the head and later consume them from
the tail.
It would be more expected (although functionally equivalent) to do the
opposite, so that the messages are in chronological order when iterating
the list in forward.
So this patch just swaps the push/pop calls around.
Change-Id: Id4892e12e064376e919647c0d8bb838156ef0fc5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1543
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
goto end;
push_msg:
- g_queue_push_head(iterator->auto_seek_msgs, (void *) msg);
+ g_queue_push_tail(iterator->auto_seek_msgs, (void *) msg);
msg = NULL;
end:
for (i = 0; i < user_count; i++) {
if (got_first) {
- g_queue_push_head(iterator->auto_seek_msgs,
+ g_queue_push_tail(iterator->auto_seek_msgs,
(void *) messages[i]);
messages[i] = NULL;
continue;
* iterator's base message array).
*/
while (capacity > 0 && !g_queue_is_empty(iterator->auto_seek_msgs)) {
- msgs[*count] = g_queue_pop_tail(iterator->auto_seek_msgs);
+ msgs[*count] = g_queue_pop_head(iterator->auto_seek_msgs);
capacity--;
(*count)++;
}