Skip to content
Snippets Groups Projects
Commit 8b0ab435 authored by Avi Kivity's avatar Avi Kivity
Browse files

sched: ensure that the scheduler is initialized before creating threads

Otherwise, expect memory corruption.
parent 739e9860
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,7 @@ void thread::on_thread_stack(thread* t) ...@@ -74,6 +74,7 @@ void thread::on_thread_stack(thread* t)
void thread::setup_tcb() void thread::setup_tcb()
{ {
assert(tls.size);
// FIXME: respect alignment // FIXME: respect alignment
void* p = malloc(sched::tls.size + sizeof(*_tcb)); void* p = malloc(sched::tls.size + sizeof(*_tcb));
memset(p, 0, sched::tls.size); memset(p, 0, sched::tls.size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment