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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user