2012-04-02 22:18:01 -05:00
|
|
|
|
2012-03-29 17:21:32 -05:00
|
|
|
#include "rust_sched_launcher.h"
|
|
|
|
#include "rust_scheduler.h"
|
|
|
|
|
|
|
|
const size_t SCHED_STACK_SIZE = 1024*100;
|
|
|
|
|
2012-07-20 17:06:17 -05:00
|
|
|
rust_sched_launcher::rust_sched_launcher(rust_scheduler *sched, int id,
|
|
|
|
bool killed)
|
2012-04-01 00:00:08 -05:00
|
|
|
: kernel(sched->kernel),
|
2012-07-20 17:06:17 -05:00
|
|
|
sched_loop(sched, id, killed),
|
2012-03-30 19:10:02 -05:00
|
|
|
driver(&sched_loop) {
|
2012-03-29 17:21:32 -05:00
|
|
|
}
|
2012-04-01 00:00:08 -05:00
|
|
|
|
|
|
|
rust_thread_sched_launcher::rust_thread_sched_launcher(rust_scheduler *sched,
|
2012-07-20 17:06:17 -05:00
|
|
|
int id, bool killed)
|
|
|
|
: rust_sched_launcher(sched, id, killed),
|
2012-04-01 00:00:08 -05:00
|
|
|
rust_thread(SCHED_STACK_SIZE) {
|
|
|
|
}
|
|
|
|
|
2012-04-01 18:21:48 -05:00
|
|
|
rust_manual_sched_launcher::rust_manual_sched_launcher(rust_scheduler *sched,
|
2012-07-20 17:06:17 -05:00
|
|
|
int id, bool killed)
|
|
|
|
: rust_sched_launcher(sched, id, killed) {
|
2012-04-01 18:21:48 -05:00
|
|
|
}
|
2012-04-01 19:22:24 -05:00
|
|
|
|
|
|
|
rust_sched_launcher *
|
2012-07-20 17:06:17 -05:00
|
|
|
rust_thread_sched_launcher_factory::create(rust_scheduler *sched, int id,
|
|
|
|
bool killed) {
|
2012-04-01 19:22:24 -05:00
|
|
|
return new(sched->kernel, "rust_thread_sched_launcher")
|
2012-07-20 17:06:17 -05:00
|
|
|
rust_thread_sched_launcher(sched, id, killed);
|
2012-04-01 19:22:24 -05:00
|
|
|
}
|
2012-04-01 19:35:35 -05:00
|
|
|
|
|
|
|
rust_sched_launcher *
|
2012-07-20 17:06:17 -05:00
|
|
|
rust_manual_sched_launcher_factory::create(rust_scheduler *sched, int id,
|
|
|
|
bool killed) {
|
2012-04-01 19:35:35 -05:00
|
|
|
assert(launcher == NULL && "I can only track one sched_launcher");
|
2012-04-01 20:42:28 -05:00
|
|
|
launcher = new(sched->kernel, "rust_manual_sched_launcher")
|
2012-07-20 17:06:17 -05:00
|
|
|
rust_manual_sched_launcher(sched, id, killed);
|
2012-04-01 20:42:28 -05:00
|
|
|
return launcher;
|
2012-04-01 19:35:35 -05:00
|
|
|
}
|