From a52cce2963f3f16739862757869337b90f8a3615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 12 Oct 2004 03:55:46 +0000 Subject: [PATCH] Moved thread_kthread_{entry|exit}() to where they are found easier. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9294 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/thread.c | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c index 01d113f970..114591ab4a 100644 --- a/src/kernel/core/thread.c +++ b/src/kernel/core/thread.c @@ -228,6 +228,28 @@ delete_thread_struct(struct thread *thread) } +// this function gets run by a new thread before anything else + +static void +thread_kthread_entry(void) +{ + // simulates the thread spinlock release that would occur if the thread had been + // rescheded from. The resched didn't happen because the thread is new. + RELEASE_THREAD_LOCK(); + enable_interrupts(); // this essentially simulates a return-from-interrupt +} + + +static void +thread_kthread_exit(void) +{ + struct thread *t = thread_get_current_thread(); + + t->return_flags = THREAD_RETURN_EXIT; + thread_exit(); +} + + /** Initializes the thread and jumps to its userspace entry point. * This function is called at creation time of every user thread, * but not for a team's main thread. @@ -623,18 +645,6 @@ put_death_stack_and_reschedule(uint32 index) } -// this function gets run by a new thread before anything else - -static void -thread_kthread_entry(void) -{ - // simulates the thread spinlock release that would occur if the thread had been - // rescheded from. The resched didn't happen because the thread is new. - RELEASE_THREAD_LOCK(); - enable_interrupts(); // this essentially simulates a return-from-interrupt -} - - // used to pass messages between thread_exit and thread_exit2 struct thread_exit_args { @@ -812,16 +822,6 @@ thread_exit(void) } -static void -thread_kthread_exit(void) -{ - struct thread *t = thread_get_current_thread(); - - t->return_flags = THREAD_RETURN_EXIT; - thread_exit(); -} - - struct thread * thread_get_thread_struct(thread_id id) {