summaryrefslogtreecommitdiff
path: root/src/thread.h
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-12-20 20:59:07 +0200
committerEli Zaretskii <eliz@gnu.org>2019-12-20 20:59:07 +0200
commit0e19b5d757d88eedd23709a4ea40aa1512a1ff21 (patch)
tree5ab479668337f979c29e41e9254fa609d463391c /src/thread.h
parent85a60da92d4db5c87ecfa152501d246425550fc3 (diff)
downloademacs-0e19b5d757d88eedd23709a4ea40aa1512a1ff21.tar.gz
Support setting OS names of threads on MS-Windows
* src/w32fns.c (setup_w32_kbdhook): Don't initialize is_debugger_present here... (globals_of_w32fns): ...initialize it here. Also initialize the new global variable set_thread_description. * src/systhread.c: [WINDOWSNT] Include mbctype.h (w32_set_thread_name): New function. (MS_VC_EXCEPTION): New macro. (THREADNAME_INFO, IsDebuggerPresent_Proc) (SetThreadDescription_Proc): New typedefs. (w32_beginthread_wrapper): Call w32_set_thread_name to set the name of the new thread. * src/thread.h (struct thread_state): New member thread_name. * src/thread.c (Fmake_thread): Set the thread_name field of the new thread object. (run_thread): Free the thread_name member after the thread exits.
Diffstat (limited to 'src/thread.h')
-rw-r--r--src/thread.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/thread.h b/src/thread.h
index 498b9909c9f..2b85f0893e7 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -169,6 +169,10 @@ struct thread_state
interrupter should broadcast to this condition. */
sys_cond_t *wait_condvar;
+ /* Thread's name in the locale encoding. Actually used only on
+ WINDOWSNT. */
+ char *thread_name;
+
/* This thread might have released the global lock. If so, this is
non-zero. When a thread runs outside thread_select with this
flag non-zero, it means it has been interrupted by SIGINT while