Skip to content

Commit 298bab9

Browse files
authored
Merge pull request #5326 from Kelimion/fix-5321
Revert changes to thread_unix.odin
2 parents b119ca0 + 5aa377e commit 298bab9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

core/thread/thread_unix.odin

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ _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+
3032
if .Started not_in sync.atomic_load(&t.flags) {
3133
sync.wait(&t.start_ok)
3234
}
@@ -122,13 +124,6 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
122124
free(thread, thread.creation_allocator)
123125
return nil
124126
}
125-
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-
}
132127
return thread
133128
}
134129

0 commit comments

Comments
 (0)