2012-04-02 22:18:01 -05:00
|
|
|
|
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;
|
|
|
|
|
2012-04-01 22:18:40 -05:00
|
|
|
rust_sched_launcher::rust_sched_launcher(rust_scheduler *sched, int id)
|
2012-03-31 22:00:08 -07:00
|
|
|
: kernel(sched->kernel),
|
2012-04-01 22:18:40 -05:00
|
|
|
sched_loop(sched, id),
|
2012-03-30 17:10:02 -07:00
|
|
|
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 22:18:40 -05:00
|
|
|
int id)
|
|
|
|
: rust_sched_launcher(sched, id),
|
2012-03-31 22:00:08 -07:00
|
|
|
rust_thread(SCHED_STACK_SIZE) {
|
|
|
|
}
|
|
|
|
|
2012-04-01 16:21:48 -07:00
|
|
|
rust_manual_sched_launcher::rust_manual_sched_launcher(rust_scheduler *sched,
|
2012-04-03 20:29:12 -07:00
|
|
|
int id)
|
|
|
|
: rust_sched_launcher(sched, id) {
|
2012-04-01 16:21:48 -07:00
|
|
|
}
|
2012-04-01 17:22:24 -07:00
|
|
|
|
|
|
|
rust_sched_launcher *
|
|
|
|
rust_thread_sched_launcher_factory::create(rust_scheduler *sched, int id) {
|
|
|
|
return new(sched->kernel, "rust_thread_sched_launcher")
|
2012-04-03 20:29:12 -07:00
|
|
|
rust_thread_sched_launcher(sched, id);
|
2012-04-01 17:22:24 -07:00
|
|
|
}
|
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");
|
2012-04-01 18:42:28 -07:00
|
|
|
launcher = new(sched->kernel, "rust_manual_sched_launcher")
|
2012-04-03 20:29:12 -07:00
|
|
|
rust_manual_sched_launcher(sched, id);
|
2012-04-01 18:42:28 -07:00
|
|
|
return launcher;
|
2012-04-01 17:35:35 -07:00
|
|
|
}
|