aboutsummaryrefslogtreecommitdiff
path: root/src/unix/internal.h
diff options
context:
space:
mode:
authorSantiago Gimeno <santiago.gimeno@gmail.com>2024-11-27 12:52:18 +0100
committerGitHub <noreply@github.com>2024-11-27 12:52:18 +0100
commit61c966cf0b4b6b5fc44d5ab3678cf5d0caef249d (patch)
treeb40a8e28b1eb0b2c31e05bd16f682511619a544d /src/unix/internal.h
parentb7d07d78e976acc453c9ba8f8409650c2ad8a585 (diff)
downloadlibuv-61c966cf0b4b6b5fc44d5ab3678cf5d0caef249d.tar.gz
libuv-61c966cf0b4b6b5fc44d5ab3678cf5d0caef249d.zip
src: add uv_thread_set/getname() methods (#4599)
`uv_thread_setname()` sets the name of the current thread. Different platforms define different limits on the max number of characters a thread name can be: Linux, IBMi (16), macOS (64), Windows (32767), and NetBSD (32), etc. `uv_thread_setname()` will truncate it in case `name` is larger than the limit of the platform. `uv_thread_getname()` gets the name of the thread specified by `tid`. The thread name is copied into the buffer pointed to by `name`. The `size` parameter specifies the size of the buffer pointed to by `name`. The buffer should be large enough to hold the name of the thread plus the trailing NUL, or it will be truncated to fit.
Diffstat (limited to 'src/unix/internal.h')
-rw-r--r--src/unix/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/unix/internal.h b/src/unix/internal.h
index 698caf17..b1d2b217 100644
--- a/src/unix/internal.h
+++ b/src/unix/internal.h
@@ -327,6 +327,8 @@ void uv__prepare_close(uv_prepare_t* handle);
void uv__process_close(uv_process_t* handle);
void uv__stream_close(uv_stream_t* handle);
void uv__tcp_close(uv_tcp_t* handle);
+int uv__thread_setname(const char* name);
+int uv__thread_getname(uv_thread_t* tid, char* name, size_t size);
size_t uv__thread_stack_size(void);
void uv__udp_close(uv_udp_t* handle);
void uv__udp_finish_close(uv_udp_t* handle);