diff --git a/headers/private/kernel/thread.h b/headers/private/kernel/thread.h index 5ea3f7cbb3..469e339290 100644 --- a/headers/private/kernel/thread.h +++ b/headers/private/kernel/thread.h @@ -73,11 +73,6 @@ using BKernel::ThreadCreationAttributes; extern "C" { #endif -void thread_enqueue(Thread *t, struct thread_queue *q); -Thread *thread_lookat_queue(struct thread_queue *q); -Thread *thread_dequeue(struct thread_queue *q); -Thread *thread_dequeue_id(struct thread_queue *q, thread_id id); - void thread_at_kernel_entry(bigtime_t now); // called when the thread enters the kernel on behalf of the thread void thread_at_kernel_exit(void); diff --git a/headers/private/kernel/thread_types.h b/headers/private/kernel/thread_types.h index b182032bd1..9afb2f516d 100644 --- a/headers/private/kernel/thread_types.h +++ b/headers/private/kernel/thread_types.h @@ -418,7 +418,6 @@ struct Thread : TeamThreadIteratorEntry, KernelReferenceable, int64 serial_number; // immutable after adding thread to hash Thread *hash_next; // protected by thread hash lock Thread *team_next; // protected by team lock and fLock - Thread *queue_next; // protected by scheduler lock timer alarm; // protected by scheduler lock char name[B_OS_NAME_LENGTH]; // protected by fLock int32 priority; // protected by scheduler lock @@ -781,12 +780,6 @@ using BKernel::ProcessGroup; using BKernel::ProcessGroupList; -struct thread_queue { - Thread* head; - Thread* tail; -}; - - #endif // !_ASSEMBLER diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index 4c4f142ed3..391a487fbe 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -165,7 +165,6 @@ Thread::Thread(const char* name, thread_id threadID, struct cpu_ent* cpu) serial_number(-1), hash_next(NULL), team_next(NULL), - queue_next(NULL), priority(-1), io_priority(-1), cpu(cpu), @@ -1698,8 +1697,8 @@ _dump_thread_info(Thread *thread, bool shortInfo) thread->id); kprintf("serial_number: %" B_PRId64 "\n", thread->serial_number); kprintf("name: \"%s\"\n", thread->name); - kprintf("hash_next: %p\nteam_next: %p\nq_next: %p\n", - thread->hash_next, thread->team_next, thread->queue_next); + kprintf("hash_next: %p\nteam_next: %p\n", + thread->hash_next, thread->team_next); kprintf("priority: %" B_PRId32 " (I/O: %" B_PRId32 ")\n", thread->priority, thread->io_priority); kprintf("state: %s\n", state_to_text(thread, thread->state)); @@ -2348,67 +2347,6 @@ thread_reset_for_exec(void) } -/*! Insert a thread to the tail of a queue */ -void -thread_enqueue(Thread *thread, struct thread_queue *queue) -{ - thread->queue_next = NULL; - if (queue->head == NULL) { - queue->head = thread; - queue->tail = thread; - } else { - queue->tail->queue_next = thread; - queue->tail = thread; - } -} - - -Thread * -thread_lookat_queue(struct thread_queue *queue) -{ - return queue->head; -} - - -Thread * -thread_dequeue(struct thread_queue *queue) -{ - Thread *thread = queue->head; - - if (thread != NULL) { - queue->head = thread->queue_next; - if (queue->tail == thread) - queue->tail = NULL; - } - return thread; -} - - -Thread * -thread_dequeue_id(struct thread_queue *q, thread_id id) -{ - Thread *thread; - Thread *last = NULL; - - thread = q->head; - while (thread != NULL) { - if (thread->id == id) { - if (last == NULL) - q->head = thread->queue_next; - else - last->queue_next = thread->queue_next; - - if (q->tail == thread) - q->tail = last; - break; - } - last = thread; - thread = thread->queue_next; - } - return thread; -} - - thread_id allocate_thread_id() {