util: Use literal instead call to list_inithead in u_queue.c

This is a more convenient way to struct list_head variable.
And removed the need to call list_inithead in global_init

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18092>
This commit is contained in:
Yonggang Luo 2022-06-20 18:35:06 +08:00 committed by Marge Bot
parent ddd74bec38
commit f9d7308014

View file

@ -55,7 +55,10 @@ util_queue_kill_threads(struct util_queue *queue, unsigned keep_num_threads,
*/
static once_flag atexit_once_flag = ONCE_FLAG_INIT;
static struct list_head queue_list;
static struct list_head queue_list = {
.next = &queue_list,
.prev = &queue_list,
};
static mtx_t exit_mutex = _MTX_INITIALIZER_NP;
static void
@ -74,7 +77,6 @@ atexit_handler(void)
static void
global_init(void)
{
list_inithead(&queue_list);
atexit(atexit_handler);
}