aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
authorTom Tromey2012-08-20 12:17:36 -0600
committerTom Tromey2012-08-20 12:17:36 -0600
commit68608de20310c42c5719fe99e556847fac9dd1f2 (patch)
treeb656eb2541a476f8f5afdbb710c61347e37bf864 /src/thread.c
parentfb77afbe75308507885113a56017f095da8ba1cc (diff)
downloademacs-68608de20310c42c5719fe99e556847fac9dd1f2.tar.gz
emacs-68608de20310c42c5719fe99e556847fac9dd1f2.zip
pass the thread name to the OS if possible
use prctl to pass the thread name to the OS, if possible
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/thread.c b/src/thread.c
index dba84fd0fb6..01d2fd0d6eb 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include "character.h" 23#include "character.h"
24#include "buffer.h" 24#include "buffer.h"
25#include "process.h" 25#include "process.h"
26#include "coding.h"
26 27
27static struct thread_state primary_thread; 28static struct thread_state primary_thread;
28 29
@@ -682,6 +683,7 @@ If NAME is given, it names the new thread. */)
682 sys_thread_t thr; 683 sys_thread_t thr;
683 struct thread_state *new_thread; 684 struct thread_state *new_thread;
684 Lisp_Object result; 685 Lisp_Object result;
686 const char *c_name = NULL;
685 687
686 /* Can't start a thread in temacs. */ 688 /* Can't start a thread in temacs. */
687 if (!initialized) 689 if (!initialized)
@@ -716,7 +718,10 @@ If NAME is given, it names the new thread. */)
716 new_thread->next_thread = all_threads; 718 new_thread->next_thread = all_threads;
717 all_threads = new_thread; 719 all_threads = new_thread;
718 720
719 if (! sys_thread_create (&thr, run_thread, new_thread)) 721 if (!NILP (name))
722 c_name = SSDATA (ENCODE_UTF_8 (name));
723
724 if (! sys_thread_create (&thr, c_name, run_thread, new_thread))
720 { 725 {
721 /* Restore the previous situation. */ 726 /* Restore the previous situation. */
722 all_threads = all_threads->next_thread; 727 all_threads = all_threads->next_thread;