about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-07-27 14:34:39 -0700
committerBrian Anderson <banderson@mozilla.com>2011-07-28 12:23:01 -0700
commit4ef1ec580aaf9f95d66c1654ce942f5e454a0b4d (patch)
tree39b600f84688f7e49c734285593fbe9911214cd5 /src/rt/rust_kernel.cpp
parent75985ab75ed216cd8c873c9ef08cd88708f8354f (diff)
downloadrust-4ef1ec580aaf9f95d66c1654ce942f5e454a0b4d.tar.gz
rust-4ef1ec580aaf9f95d66c1654ce942f5e454a0b4d.zip
Do all runtime calls to getenv at initialization
getenv is not threadsafe and (maybe as a result) it's randomly crashing with
CFLAGS=-g and RUST_THREADS=32. Calls from rust code are still on their
own.
Diffstat (limited to 'src/rt/rust_kernel.cpp')
-rw-r--r--src/rt/rust_kernel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index 8839f7fe6af..a4f56c10be2 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -12,7 +12,8 @@ rust_kernel::rust_kernel(rust_srv *srv, size_t num_threads) :
     _interrupt_kernel_loop(FALSE),
     num_threads(num_threads),
     rval(0),
-    live_tasks(0)
+    live_tasks(0),
+    env(srv->env)
 {
     isaac_init(this, &rctx);
     create_schedulers();
@@ -51,6 +52,8 @@ rust_kernel::destroy_scheduler(rust_scheduler *sched) {
 }
 
 void rust_kernel::create_schedulers() {
+    KLOG_("Using %d scheduler threads.", num_threads);
+
     for(size_t i = 0; i < num_threads; ++i) {
         threads.push(create_scheduler(i));
     }