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

This commit is contained in:
hikari committed 2023-06-07 19:11:16 +03:00
1 parent 7dc09ed450
commit dcf4e51787
4 files changed
+41 -102

No files matched your search

+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
}