From ebc3646c39e2a24fe6eec778fb7ca5862d95acf7 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 6 Feb 2012 21:12:59 -0800 Subject: rt: Start schedulers immediately upon creation --- src/rt/rust_kernel.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/rt/rust_kernel.cpp') diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp index 3b9a60a3064..8c1278a88db 100644 --- a/src/rt/rust_kernel.cpp +++ b/src/rt/rust_kernel.cpp @@ -60,6 +60,7 @@ rust_kernel::create_scheduler(size_t num_threads) { sched = new (this, "rust_scheduler") rust_scheduler(this, srv, num_threads, 0); live_schedulers = 1; + sched->start_task_threads(); return 0; } @@ -84,15 +85,12 @@ int rust_kernel::wait_for_schedulers() { I(this, !sched_lock.lock_held_by_current_thread()); - sched->start_task_threads(); - { - scoped_lock with(sched_lock); - // Schedulers could possibly have already exited - if (live_schedulers != 0) { - sched_lock.wait(); - } - return rval; + scoped_lock with(sched_lock); + // Schedulers could possibly have already exited + if (live_schedulers != 0) { + sched_lock.wait(); } + return rval; } void -- cgit 1.4.1-3-g733a5