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.
This commit is contained in:
Brian Anderson
2011-07-27 14:34:39 -07:00
parent 75985ab75e
commit 4ef1ec580a
17 changed files with 182 additions and 86 deletions

View File

@@ -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));
}