mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 02:40:05 +00:00
[core:thread] Seeing if this fixes network tests
This commit is contained in:
@@ -6,17 +6,10 @@ import "core:intrinsics"
|
||||
import "core:sync"
|
||||
import win32 "core:sys/windows"
|
||||
|
||||
Thread_State :: enum u8 {
|
||||
Started,
|
||||
Joined,
|
||||
Done,
|
||||
}
|
||||
|
||||
Thread_Os_Specific :: struct {
|
||||
win32_thread: win32.HANDLE,
|
||||
win32_thread_id: win32.DWORD,
|
||||
mutex: sync.Mutex,
|
||||
flags: bit_set[Thread_State; u8],
|
||||
}
|
||||
|
||||
_thread_priority_map := [Thread_Priority]i32{
|
||||
@@ -47,7 +40,7 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
|
||||
|
||||
intrinsics.atomic_store(&t.flags, t.flags + {.Done})
|
||||
|
||||
if t.self_cleanup {
|
||||
if .Self_Cleanup in t.flags {
|
||||
win32.CloseHandle(t.win32_thread)
|
||||
t.win32_thread = win32.INVALID_HANDLE
|
||||
// NOTE(ftphikari): It doesn't matter which context 'free' received, right?
|
||||
|
||||
Reference in New Issue
Block a user