rt: Extract rust_sched_launcher from rust_task_thread
rust_sched_launcher is actually responsible for setting up the thread and starting the loop. There will be other implementations that do not actually set up a new thread, in order to support scheduling tasks on the main OS thread.
This commit is contained in:
@@ -13,7 +13,6 @@ pthread_key_t rust_task_thread::task_key;
|
||||
DWORD rust_task_thread::task_key;
|
||||
#endif
|
||||
|
||||
const size_t SCHED_STACK_SIZE = 1024*100;
|
||||
const size_t C_STACK_SIZE = 1024*1024;
|
||||
|
||||
bool rust_task_thread::tls_initialized = false;
|
||||
@@ -21,7 +20,6 @@ bool rust_task_thread::tls_initialized = false;
|
||||
rust_task_thread::rust_task_thread(rust_scheduler *sched,
|
||||
rust_srv *srv,
|
||||
int id) :
|
||||
rust_thread(SCHED_STACK_SIZE),
|
||||
_log(srv, this),
|
||||
id(id),
|
||||
should_exit(false),
|
||||
@@ -256,6 +254,8 @@ rust_task_thread::start_main_loop() {
|
||||
destroy_stack(kernel->region(), cached_c_stack);
|
||||
cached_c_stack = NULL;
|
||||
}
|
||||
|
||||
sched->release_task_thread();
|
||||
}
|
||||
|
||||
rust_task *
|
||||
@@ -327,11 +327,6 @@ rust_task_thread::transition(rust_task *task,
|
||||
lock.signal();
|
||||
}
|
||||
|
||||
void rust_task_thread::run() {
|
||||
this->start_main_loop();
|
||||
sched->release_task_thread();
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
void
|
||||
rust_task_thread::init_tls() {
|
||||
|
||||
Reference in New Issue
Block a user