Commit 98dccd8a authored by Stefan Lankes's avatar Stefan Lankes Committed by Stefan Lankes
Browse files

create TLS only if TLS isn't already initialized

parent b8068482
...@@ -343,11 +343,10 @@ impl TaskFrame for Task { ...@@ -343,11 +343,10 @@ impl TaskFrame for Task {
fn create_stack_frame(&mut self, func: extern "C" fn(usize), arg: usize) { fn create_stack_frame(&mut self, func: extern "C" fn(usize), arg: usize) {
// Check if the task (process or thread) uses Thread-Local-Storage. // Check if the task (process or thread) uses Thread-Local-Storage.
let tls_size = environment::get_tls_memsz(); let tls_size = environment::get_tls_memsz();
self.tls = if tls_size > 0 { // check is TLS is already allocated
Some(TaskTLS::new(tls_size)) if self.tls.is_none() && tls_size > 0 {
} else { self.tls = Some(TaskTLS::new(tls_size))
None }
};
unsafe { unsafe {
// Set a marker for debugging at the very top. // Set a marker for debugging at the very top.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment