Skip to content
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0a3f730
Get/Set Thread names
peperronii Jul 14, 2025
b87b543
substitute 'do'
peperronii Jul 14, 2025
6f3cc31
substitute sync.current_thread_id with posix.pthread_self for unix
peperronii Jul 14, 2025
7265782
remove unnecessary spaces, fix t -> thread, added more description
peperronii Jul 14, 2025
8bc1ffd
remove 'do'
peperronii Jul 14, 2025
c078300
fix proc and variable typos
peperronii Jul 14, 2025
552b4b6
fix GetThreadDescription ^PCWSTR to PWSTR
peperronii Jul 14, 2025
d875d2d
added set_name in thread_other
peperronii Jul 14, 2025
02111e7
no #optional_allocator_error
peperronii Jul 15, 2025
08c2988
spacing
peperronii Jul 15, 2025
05b7697
more spacing
peperronii Jul 15, 2025
5ffba9b
use copy proc group instead of copy_from_string
peperronii Jul 15, 2025
805c322
Update core/thread/thread_unix.odin
peperronii Jul 15, 2025
9aa4afe
GetThreadDescription ^PWSTR
peperronii Jul 15, 2025
8f81b87
changed [^]u8 to cstring for netbsd, added truncate_to_byte(name,0) o…
peperronii Jul 15, 2025
228e275
use win32.wstring_to_utf8, default to temp_allocator, guarantees prop…
peperronii Jul 15, 2025
ea20383
Merge branch 'master' into master
peperronii Jul 15, 2025
8d278ac
fix system:System.Framework pthread.odin
peperronii Jul 15, 2025
a357113
thread.create et al with name parameter
peperronii Jul 22, 2025
3c9d05a
fix tid/handle bug on macos/win
peperronii Jul 22, 2025
2f770ff
check for Haiku before calling _set_name
peperronii Jul 22, 2025
c164332
Apply suggestions from code review
peperronii Aug 20, 2025
155c03a
Merge branch 'odin-lang:master' into master
peperronii Aug 20, 2025
8884ad0
added name argument description
peperronii Aug 20, 2025
5ab3c17
fixed windows api and free GetThreadName's allocation
peperronii Aug 20, 2025
e4cc58d
thread.name = name in unix
peperronii Aug 28, 2025
704a917
re-added Haiku os _set_name guard
peperronii Aug 28, 2025
ed75ab4
Change windows Thread_Description_Length to 128
peperronii Sep 14, 2025
f873231
Update thread name/description truncation limits
peperronii Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/sys/windows/kernel32.odin
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I’m not sure about this API call. per documentation it might be ^PWSTR but that doesn’t make sense cause it’s a pointer to a pointer.

Copy link
Contributor

@blob1807 blob1807 Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a pointer to a pointer because it's writing the buffer's pointer at the one we give it. It doesn't copy the whole buffer back to you. It just returns a pointer to it.

Copy link
Contributor Author

@peperronii peperronii Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to still manually allocate a buffer for the entire string or we’ll be fine just using the pointer?
edit:I forgot that we’d have to allocate for the returned string anyway, but I’m still curious how it will manage the buffer after the call.

Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ foreign kernel32 {
ResumeThread :: proc(thread: HANDLE) -> DWORD ---
GetThreadPriority :: proc(thread: HANDLE) -> c_int ---
SetThreadPriority :: proc(thread: HANDLE, priority: c_int) -> BOOL ---
GetThreadDescription :: proc(hThread: HANDLE, ppszThreadDescription: ^PCWSTR) -> HRESULT ---
GetThreadDescription :: proc(hThread: HANDLE, ppszThreadDescription: PWSTR) -> HRESULT ---
SetThreadDescription :: proc(hThread: HANDLE, lpThreadDescription: PCWSTR) -> HRESULT ---
GetExitCodeThread :: proc(thread: HANDLE, exit_code: ^DWORD) -> BOOL ---
TerminateThread :: proc(thread: HANDLE, exit_code: DWORD) -> BOOL ---
Expand Down
Loading