From 6bf8d19712e2310ab6a7da2e82b2287278a772e4 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 29 Mar 2012 15:21:32 -0700 Subject: rt: Extract rust_sched_launcher from rust_task_thread rust_sched_launcher is actually responsible for setting up the thread and starting the loop. There will be other implementations that do not actually set up a new thread, in order to support scheduling tasks on the main OS thread. --- src/rt/rust_task_thread.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/rt/rust_task_thread.cpp') diff --git a/src/rt/rust_task_thread.cpp b/src/rt/rust_task_thread.cpp index 6a5b8bc2ab0..d692de1414d 100644 --- a/src/rt/rust_task_thread.cpp +++ b/src/rt/rust_task_thread.cpp @@ -13,7 +13,6 @@ pthread_key_t rust_task_thread::task_key; DWORD rust_task_thread::task_key; #endif -const size_t SCHED_STACK_SIZE = 1024*100; const size_t C_STACK_SIZE = 1024*1024; bool rust_task_thread::tls_initialized = false; @@ -21,7 +20,6 @@ bool rust_task_thread::tls_initialized = false; rust_task_thread::rust_task_thread(rust_scheduler *sched, rust_srv *srv, int id) : - rust_thread(SCHED_STACK_SIZE), _log(srv, this), id(id), should_exit(false), @@ -256,6 +254,8 @@ rust_task_thread::start_main_loop() { destroy_stack(kernel->region(), cached_c_stack); cached_c_stack = NULL; } + + sched->release_task_thread(); } rust_task * @@ -327,11 +327,6 @@ rust_task_thread::transition(rust_task *task, lock.signal(); } -void rust_task_thread::run() { - this->start_main_loop(); - sched->release_task_thread(); -} - #ifndef _WIN32 void rust_task_thread::init_tls() { -- cgit 1.4.1-3-g733a5