about summary refs log tree commit diff
path: root/src/rt/rust_srv.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_srv.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_srv.cpp')
-rw-r--r--src/rt/rust_srv.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rt/rust_srv.cpp b/src/rt/rust_srv.cpp
index 05c9d9d564c..835b283a73f 100644
--- a/src/rt/rust_srv.cpp
+++ b/src/rt/rust_srv.cpp
@@ -1,7 +1,8 @@
 #include "rust_internal.h"
 #include "rust_srv.h"
 
-rust_srv::rust_srv() :
+rust_srv::rust_srv(rust_env *env) :
+    env(env),
     local_region(this, false) {
 }
 
@@ -72,7 +73,7 @@ rust_srv::warning(char const *expression,
 
 rust_srv *
 rust_srv::clone() {
-    return new rust_srv();
+    return new rust_srv(env);
 }
 
 //