aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
authorGlenn Morris2020-01-08 09:09:47 -0800
committerGlenn Morris2020-01-08 09:09:47 -0800
commitb968b733a2a0450eb7312a5e72c059ec3c59ddd9 (patch)
treeda0790ada823a4d7dee009e9df63b3b24d0d539b /src/thread.c
parentf8a0b02949342b887822e7756fd36f06536c9c01 (diff)
parent6cd9ccb0a28ec03ffe180b7429e0378511b7d459 (diff)
downloademacs-b968b733a2a0450eb7312a5e72c059ec3c59ddd9.tar.gz
emacs-b968b733a2a0450eb7312a5e72c059ec3c59ddd9.zip
Merge from origin/emacs-27
6cd9ccb0a2 (origin/emacs-27) Fix compression of directories in Dired 42329e6d3b ; * etc/NEWS: Review of the whole text. af5709f16b Further enhancement on `tramp-file-local-name' fb432446f5 Objective C Mode imenu: cease recognizing "functions" with... a18373a999 ; * etc/NEWS: Update the text about the XDG_CONFIG_HOME/em... 73fd8a4b53 Fix BSD and macOS builds w.r.t. pthread_setname_np (bug#38... f54b24304d Scale top-left coordinates in display-monitor-attributes-list b46c75b16c xref-matches-in-files: Big Tramp speed-up 883b3490d8 * lisp/net/tramp.el (tramp-file-local-name): Remove `save-... c01f55f126 Fix rendering bug due to unsynchronized cairo surface size... 075f21c0e3 Avoid crash by access to cleared img->pixmap->data/img->ma... 16c6dfb4f1 Avoid assertion violations in very small-height windows 9063124b91 Use pthread_setname_np to set thread name # Conflicts: # etc/NEWS # lisp/net/tramp.el
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/thread.c b/src/thread.c
index f81163414bb..c7fe0614269 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;