substitute 'do'

This commit is contained in:
PePerRoNii
2025-07-14 18:10:35 +07:00
parent 0a3f73077e
commit b87b5431b1
2 changed files with 20 additions and 8 deletions

View File

@@ -190,8 +190,11 @@ _get_name :: proc(thread: ^Thread, allocator: runtime.Allocator, loc: runtime.So
}
tid : posix.pthread_t
if thread == nil do tid = transmute(posix.pthread_t)sync.current_thread_id()
else do tid = thread.unix_thread
if thread == nil {
tid = transmute(posix.pthread_t)sync.current_thread_id()
} else {
tid = thread.unix_thread
}
buf := make([]u8, _MAX_PTHREAD_NAME_LENGTH, allocator, loc) or_return
@@ -214,8 +217,11 @@ _set_name :: proc(thread: ^Thread, name:string) {
if thread != nil do return
} else {
tid: posix.pthread_t
if thread == nil do tid = transmute(posix.pthread_t)sync.current_thread_id
else do tid = t.unix_thread
if thread == nil {
tid = transmute(posix.pthread_t)sync.current_thread_id
} else {
tid = t.unix_thread
}
}
buf : [_MAX_PTHREAD_NAME_LENGTH]u8

View File

@@ -157,8 +157,11 @@ _yield :: proc() {
_get_name :: proc(thread: ^Thread, allocator: runtime.Allocator, loc : runtime.Source_Code_Location) -> (name:string, err:runtime.Allocator_Error) {
t_handle : win32.HANDLE
if thread == nil do t_handle = win32.GetCurrentThread()
else do t_handle = t.win32_thread
if thread == nil {
t_handle = win32.GetCurrentThread()
} else {
t_handle = t.win32_thread
}
buf_8 : [_THREAD_DESCRIPTION_LENGTH * 2]u8
buf_16 : [_THREAD_DESCRIPTION_LENGTH]u16
@@ -175,8 +178,11 @@ _get_name :: proc(thread: ^Thread, allocator: runtime.Allocator, loc : runtime.S
_set_name :: proc(thread: ^Thread, name: string) {
t_handle : win32.HANDLE
if thread == nil do t_handle = win32.GetCurrentThread()
else do t_handle = t.win32_thread
if thread == nil {
t_handle = win32.GetCurrentThread()
} else {
t_handle = t.win32_thread
}
buf : [_THREAD_DESCRIPTION_LENGTH]u16
utf16.encode_string(buf_16[:], name)