summary refs log tree commit diff
path: root/src/rt/rust_task_thread.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-29 15:21:32 -0700
committerBrian Anderson <banderson@mozilla.com>2012-03-31 19:51:29 -0700
commit6bf8d19712e2310ab6a7da2e82b2287278a772e4 (patch)
treec57072780959c41cd02b9b2f48d003b89ddb9632 /src/rt/rust_task_thread.cpp
parent620b4d4946dbaf41ec8c0c7f9ba5c5d9810db89b (diff)
downloadrust-6bf8d19712e2310ab6a7da2e82b2287278a772e4.tar.gz
rust-6bf8d19712e2310ab6a7da2e82b2287278a772e4.zip
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.
Diffstat (limited to 'src/rt/rust_task_thread.cpp')
-rw-r--r--src/rt/rust_task_thread.cpp9
1 files changed, 2 insertions, 7 deletions
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() {