0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-12-01 13:18:54 +01:00

rt: Start schedulers immediately upon creation

This commit is contained in:
Brian Anderson 2012-02-06 21:12:59 -08:00
parent 7685e5de94
commit ebc3646c39

View File

@ -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