Skip to content

Commit b119ca0

Browse files
authored
Merge pull request #5325 from Kelimion/fix-5321
Fix #5321
2 parents eb1b5f7 + 59ba37f commit b119ca0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/thread/thread_unix.odin

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
2727
// most of the time, don't ask me why.
2828
can_set_thread_cancel_state := posix.pthread_setcancelstate(.DISABLE when ODIN_OS == .Darwin else .ENABLE, nil) == nil
2929

30-
t.id = sync.current_thread_id()
31-
3230
if .Started not_in sync.atomic_load(&t.flags) {
3331
sync.wait(&t.start_ok)
3432
}
@@ -125,6 +123,12 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
125123
return nil
126124
}
127125

126+
127+
when size_of(posix.pthread_t) == size_of(i64) {
128+
thread.id = int((^i64)(&thread.unix_thread)^)
129+
} else {
130+
thread.id = int((^i32)(&thread.unix_thread)^)
131+
}
128132
return thread
129133
}
130134

0 commit comments

Comments
 (0)