|
@@ -2,6 +2,7 @@
|
|
// +private
|
|
// +private
|
|
package thread
|
|
package thread
|
|
|
|
|
|
|
|
+import "base:runtime"
|
|
import "core:sync"
|
|
import "core:sync"
|
|
import "core:sys/unix"
|
|
import "core:sys/unix"
|
|
import "core:time"
|
|
import "core:time"
|
|
@@ -55,7 +56,10 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
|
|
// Here on Unix, we start the OS thread in a running state, and so we manually have it wait on a condition
|
|
// Here on Unix, we start the OS thread in a running state, and so we manually have it wait on a condition
|
|
// variable above. We must perform that waiting BEFORE we select the context!
|
|
// variable above. We must perform that waiting BEFORE we select the context!
|
|
context = _select_context_for_thread(init_context)
|
|
context = _select_context_for_thread(init_context)
|
|
- defer _maybe_destroy_default_temp_allocator(init_context)
|
|
|
|
|
|
+ defer {
|
|
|
|
+ _maybe_destroy_default_temp_allocator(init_context)
|
|
|
|
+ runtime.run_thread_local_cleaners()
|
|
|
|
+ }
|
|
|
|
|
|
t.procedure(t)
|
|
t.procedure(t)
|
|
}
|
|
}
|