diff options
author | Ivan Zhakov <ivan@apache.org> | 2023-01-21 16:13:27 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2023-01-21 16:13:27 +0000 |
commit | 9b4df62cd1117d6b4348c8a1f7871ece024eb413 (patch) | |
tree | 6b009aab810e5a22ec6ff0c167af99b0dd5e733e /include | |
parent | 545069e7dc77a47168c0667bd7080db008d402de (diff) | |
parent | 166a06a11e80a5479a806ebb5a213d1c3e547fc7 (diff) | |
download | apr-9b4df62cd1117d6b4348c8a1f7871ece024eb413.tar.gz |
Merge thread-name branch (PR 60587) [1]:
* Introduce apr_thread_name_set() and apr_thread_name_get().
[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=60587
[2] https://lists.apache.org/thread/z24logzc6v8tc0p2q3375cc10qo9y5yw
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906889 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/apr_thread_proc.h | 23 | ||||
-rw-r--r-- | include/arch/win32/apr_arch_misc.h | 10 |
2 files changed, 33 insertions, 0 deletions
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b9a7dd1fc..d9fe12a28 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -340,6 +340,29 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd); /** + * Get name of thread + * @param name The variable where is will be stored name of thread. + * @param thread The thread that name required to get. + * Current thread will be used if @param thread is NULL. + * @param cont The pool to use + */ +APR_DECLARE(apr_status_t) apr_thread_name_get(char **name, + apr_thread_t *thread, + apr_pool_t *pool); + +/** + * Set name of thread + * @param name The name of thread must be setted. If name is to long, then + * name stripped to max length supported by operation system. + * @param thread The thread that name will be changed. + * Current thread will be used if @param thread is NULL. + * @param cont The pool to use for temporary allocations + */ +APR_DECLARE(apr_status_t) apr_thread_name_set(const char *name, + apr_thread_t *thread, + apr_pool_t *pool); + +/** * force the current thread to yield the processor */ APR_DECLARE(void) apr_thread_yield(void); diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index eb8ec0838..4d8ec6162 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -293,4 +293,14 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_API_MS_WIN_DOWNLEVEL_SHELL32_L1_1_0, LPWSTR *, (LPCWSTR lpCmdLine, int *pNumArgs), (lpCmdLine, pNumArgs)); +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetThreadDescription, 0, ( + HANDLE hThread, + PWSTR *ppszThreadDescription), + (hThread, ppszThreadDescription)); + +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SetThreadDescription, 0, ( + HANDLE hThread, + PCWSTR lpThreadDescription), + (hThread, lpThreadDescription)); + #endif /* ! MISC_H */ |