[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

View File

@@ -290,7 +290,7 @@ _bad_test_found: bool
@(private="file")
_spawn_pipe_reader :: proc() {
thread.create_and_start(proc(^thread.Thread) {
thread.run(proc() {
stream := os.stream_from_handle(_read_pipe)
reader := io.to_reader(stream)
sync.post(&_pipe_reader_semaphore) // notify thread is ready
@@ -467,4 +467,4 @@ main :: proc() {
run_test_suite :: proc() -> bool {
return libc.system(fmt.caprintf("%v run verify", g_path_to_odin)) == 0
}
}