2012-03-29 15:21:32 -07:00
|
|
|
#include "rust_sched_launcher.h"
|
|
|
|
#include "rust_scheduler.h"
|
|
|
|
|
|
|
|
const size_t SCHED_STACK_SIZE = 1024*100;
|
|
|
|
|
|
|
|
rust_sched_launcher::rust_sched_launcher(rust_scheduler *sched,
|
|
|
|
rust_srv *srv, int id)
|
2012-03-31 22:00:08 -07:00
|
|
|
: kernel(sched->kernel),
|
2012-03-30 17:10:02 -07:00
|
|
|
sched_loop(sched, srv, id),
|
|
|
|
driver(&sched_loop) {
|
2012-03-29 15:21:32 -07:00
|
|
|
}
|
2012-03-31 22:00:08 -07:00
|
|
|
|
|
|
|
rust_thread_sched_launcher::rust_thread_sched_launcher(rust_scheduler *sched,
|
2012-04-01 00:13:59 -07:00
|
|
|
rust_srv *srv, int id)
|
2012-03-31 22:00:08 -07:00
|
|
|
: rust_sched_launcher(sched, srv, id),
|
|
|
|
rust_thread(SCHED_STACK_SIZE) {
|
|
|
|
}
|
|
|
|
|
2012-04-01 16:21:48 -07:00
|
|
|
rust_manual_sched_launcher::rust_manual_sched_launcher(rust_scheduler *sched,
|
|
|
|
rust_srv *srv, int id)
|
|
|
|
: rust_sched_launcher(sched, srv, id) {
|
|
|
|
}
|
2012-04-01 17:22:24 -07:00
|
|
|
|
|
|
|
rust_sched_launcher *
|
|
|
|
rust_thread_sched_launcher_factory::create(rust_scheduler *sched, int id) {
|
|
|
|
rust_srv *srv = sched->srv->clone();
|
|
|
|
return new(sched->kernel, "rust_thread_sched_launcher")
|
|
|
|
rust_thread_sched_launcher(sched, srv, id);
|
|
|
|
}
|
2012-04-01 17:35:35 -07:00
|
|
|
|
|
|
|
rust_sched_launcher *
|
|
|
|
rust_manual_sched_launcher_factory::create(rust_scheduler *sched, int id) {
|
|
|
|
assert(launcher == NULL && "I can only track one sched_launcher");
|
|
|
|
rust_srv *srv = sched->srv->clone();
|
|
|
|
return new(sched->kernel, "rust_manual_sched_launcher")
|
|
|
|
rust_manual_sched_launcher(sched, srv, id);
|
|
|
|
}
|