1/* @title: Thread queue */
2#pragma once
3#include <structures/list.h>
4#include <sync/spinlock.h>
5
6struct thread_queue {
7 struct list_head list;
8 struct spinlock lock;
9};
10
11void thread_queue_init(struct thread_queue *q);
12void thread_queue_push_back(struct thread_queue *q, struct thread *t);
13struct thread *thread_queue_pop_front(struct thread_queue *q);
14void thread_queue_clear(struct thread_queue *q);
15bool thread_queue_remove(struct thread_queue *q, struct thread *t);
16