diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-11-14 13:52:35 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-17 10:52:59 -0800 |
| commit | e6c3c4e48c6187212b5bb21b5fdb521660b6b510 (patch) | |
| tree | f558c547c4f68221dbd14392fc35c938ad6f762d /src/rt/rust_scheduler.cpp | |
| parent | f4eb25e0d032495fef50c445b211f2c2ff20eb9c (diff) | |
| download | rust-e6c3c4e48c6187212b5bb21b5fdb521660b6b510.tar.gz rust-e6c3c4e48c6187212b5bb21b5fdb521660b6b510.zip | |
rt: More work on morestack
Diffstat (limited to 'src/rt/rust_scheduler.cpp')
| -rw-r--r-- | src/rt/rust_scheduler.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rt/rust_scheduler.cpp b/src/rt/rust_scheduler.cpp index 6a88c2f2417..b17565dda46 100644 --- a/src/rt/rust_scheduler.cpp +++ b/src/rt/rust_scheduler.cpp @@ -1,6 +1,7 @@ #include <stdarg.h> #include <cassert> +#include <pthread.h> #include "rust_internal.h" #include "globals.h" @@ -12,6 +13,9 @@ DWORD rust_scheduler::task_key; bool rust_scheduler::tls_initialized = false; +// Defined in arch/*/record_sp.S. +extern "C" void rust_record_sp(uintptr_t sp); + rust_scheduler::rust_scheduler(rust_kernel *kernel, rust_srv *srv, int id) : @@ -285,6 +289,8 @@ rust_scheduler::start_main_loop() { scheduled_task->state->name); place_task_in_tls(scheduled_task); + rust_record_sp(scheduled_task->stk->limit); + //pthread_setspecific(89, (void *)scheduled_task->stk->limit); interrupt_flag = 0; @@ -374,6 +380,8 @@ rust_scheduler::place_task_in_tls(rust_task *task) { rust_task * rust_scheduler::get_task() { + if (!tls_initialized) + return NULL; rust_task *task = reinterpret_cast<rust_task *> (pthread_getspecific(task_key)); assert(task && "Couldn't get the task from TLS!"); @@ -395,6 +403,8 @@ rust_scheduler::place_task_in_tls(rust_task *task) { rust_task * rust_scheduler::get_task() { + if (!tls_initialized) + return NULL; rust_task *task = reinterpret_cast<rust_task *>(TlsGetValue(task_key)); assert(task && "Couldn't get the task from TLS!"); return task; |
