mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-27 23:41:31 +00:00
substitute 'do'
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user