[core:thread] Added self_cleanup flag to properly auto-clean threads

This commit is contained in:
hikari
2023-06-07 19:11:16 +03:00
parent 7dc09ed450
commit dcf4e51787
4 changed files with 41 additions and 102 deletions
+5
View File
@@ -67,6 +67,11 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
sync.unlock(&t.mutex)
if t.self_cleanup {
t.unix_thread = {}
free(t, t.creation_allocator)
}
return nil
}