mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix #5049
Keep in mind that `thread.create` needs an allocator to be set, as it returns `^Thread`.
This commit is contained in:
@@ -513,8 +513,10 @@ _select_context_for_thread :: proc(init_context: Maybe(runtime.Context)) -> runt
|
|||||||
Ensure that the temp allocator is thread-safe when the user provides a specific initial context to use.
|
Ensure that the temp allocator is thread-safe when the user provides a specific initial context to use.
|
||||||
Without this, the thread will use the same temp allocator state as the parent thread, and thus, bork it up.
|
Without this, the thread will use the same temp allocator state as the parent thread, and thus, bork it up.
|
||||||
*/
|
*/
|
||||||
if ctx.temp_allocator.procedure == runtime.default_temp_allocator_proc {
|
when !ODIN_DEFAULT_TO_NIL_ALLOCATOR {
|
||||||
ctx.temp_allocator.data = &runtime.global_default_temp_allocator_data
|
if ctx.temp_allocator.procedure == runtime.default_temp_allocator_proc {
|
||||||
|
ctx.temp_allocator.data = &runtime.global_default_temp_allocator_data
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user