mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-08 19:44:20 +00:00
Add id to thread.Thread
This commit is contained in:
@@ -12,6 +12,7 @@ MAX_USER_ARGUMENTS :: 8
|
||||
|
||||
Thread :: struct {
|
||||
using specific: Thread_Os_Specific,
|
||||
id: int,
|
||||
procedure: Thread_Proc,
|
||||
data: rawptr,
|
||||
user_index: int,
|
||||
|
||||
@@ -47,7 +47,8 @@ _create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^
|
||||
t.start_mutex = {}
|
||||
|
||||
context = t.init_context.? or_else runtime.default_context()
|
||||
|
||||
|
||||
t.id = sync.current_thread_id()
|
||||
t.procedure(t)
|
||||
|
||||
if t.init_context == nil {
|
||||
|
||||
@@ -24,7 +24,8 @@ _create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^
|
||||
__windows_thread_entry_proc :: proc "stdcall" (t_: rawptr) -> win32.DWORD {
|
||||
t := (^Thread)(t_)
|
||||
context = t.init_context.? or_else runtime.default_context()
|
||||
|
||||
|
||||
t.id = sync.current_thread_id()
|
||||
t.procedure(t)
|
||||
|
||||
if t.init_context == nil {
|
||||
|
||||
Reference in New Issue
Block a user