aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
authorRichard Stallman2020-02-06 18:30:47 -0500
committerRichard Stallman2020-02-06 18:30:47 -0500
commitc4be80112556e06bd7e92138e44051cc8c62e709 (patch)
tree2392fb385569e10ad9d4d0ab2a48a1771131bf4e /src/thread.c
parent53f0de5d7719b43f184ce1a910f14882aedc50bc (diff)
parent15814d0ccd95848a2a0513d93ab718a49b289598 (diff)
downloademacs-c4be80112556e06bd7e92138e44051cc8c62e709.tar.gz
emacs-c4be80112556e06bd7e92138e44051cc8c62e709.zip
Merge
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/thread.c b/src/thread.c
index f81163414bb..df1a7053826 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -725,6 +725,9 @@ run_thread (void *state)
725 self->m_stack_bottom = self->stack_top = (char *) &stack_pos; 725 self->m_stack_bottom = self->stack_top = (char *) &stack_pos;
726 self->thread_id = sys_thread_self (); 726 self->thread_id = sys_thread_self ();
727 727
728 if (self->thread_name)
729 sys_thread_set_name (self->thread_name);
730
728 acquire_global_lock (self); 731 acquire_global_lock (self);
729 732
730 /* Put a dummy catcher at top-level so that handlerlist is never NULL. 733 /* Put a dummy catcher at top-level so that handlerlist is never NULL.
@@ -826,13 +829,13 @@ If NAME is given, it must be a string; it names the new thread. */)
826 new_thread->next_thread = all_threads; 829 new_thread->next_thread = all_threads;
827 all_threads = new_thread; 830 all_threads = new_thread;
828 831
829 char const *c_name = !NILP (name) ? SSDATA (ENCODE_UTF_8 (name)) : NULL; 832 char const *c_name = !NILP (name) ? SSDATA (ENCODE_SYSTEM (name)) : NULL;
830 if (c_name) 833 if (c_name)
831 new_thread->thread_name = xstrdup (c_name); 834 new_thread->thread_name = xstrdup (c_name);
832 else 835 else
833 new_thread->thread_name = NULL; 836 new_thread->thread_name = NULL;
834 sys_thread_t thr; 837 sys_thread_t thr;
835 if (! sys_thread_create (&thr, c_name, run_thread, new_thread)) 838 if (! sys_thread_create (&thr, run_thread, new_thread))
836 { 839 {
837 /* Restore the previous situation. */ 840 /* Restore the previous situation. */
838 all_threads = all_threads->next_thread; 841 all_threads = all_threads->next_thread;
@@ -1111,9 +1114,6 @@ syms_of_threads (void)
1111 staticpro (&last_thread_error); 1114 staticpro (&last_thread_error);
1112 last_thread_error = Qnil; 1115 last_thread_error = Qnil;
1113 1116
1114 Fdefalias (intern_c_string ("thread-alive-p"),
1115 intern_c_string ("thread-live-p"), Qnil);
1116
1117 Fprovide (intern_c_string ("threads"), Qnil); 1117 Fprovide (intern_c_string ("threads"), Qnil);
1118 } 1118 }
1119 1119