diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-12-30 13:42:38 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-12-30 13:43:24 -0800 |
commit | 108ef8033be79e9e5567002e85a316ecb5e77cad (patch) | |
tree | 5fd61d7c2a5e04f0b62402183f0b1ef7733112f3 /src/thread.c | |
parent | 966d51592f07ad9de6afebcd828e667cce0f6a27 (diff) | |
download | emacs-108ef8033be79e9e5567002e85a316ecb5e77cad.tar.gz emacs-108ef8033be79e9e5567002e85a316ecb5e77cad.tar.bz2 emacs-108ef8033be79e9e5567002e85a316ecb5e77cad.zip |
Rename primary_thread to main_thread
This avoids the confusion of using two different phrases "main thread"
and "primary thread" internally to mean the same thing. See:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html
* src/thread.c (main_thread): Rename from primary_thread,
since the new name no longer clashes with main_thread_id
and Emacs internals normally call this the "main thread".
(init_main_thread): Rename from init_primary_thread.
(main_thread_p): Rename from primary_thread_p.
All uses changed.
Diffstat (limited to 'src/thread.c')
-rw-r--r-- | src/thread.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/thread.c b/src/thread.c index 560d2cfa74f..9a1198a0ccb 100644 --- a/src/thread.c +++ b/src/thread.c @@ -26,11 +26,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "coding.h" #include "syssignal.h" -static struct thread_state primary_thread; +static struct thread_state main_thread; -struct thread_state *current_thread = &primary_thread; +struct thread_state *current_thread = &main_thread; -static struct thread_state *all_threads = &primary_thread; +static struct thread_state *all_threads = &main_thread; static sys_mutex_t global_lock; @@ -927,41 +927,41 @@ thread_check_current_buffer (struct buffer *buffer) static void -init_primary_thread (void) +init_main_thread (void) { - primary_thread.header.size + main_thread.header.size = PSEUDOVECSIZE (struct thread_state, m_stack_bottom); - XSETPVECTYPE (&primary_thread, PVEC_THREAD); - primary_thread.m_last_thing_searched = Qnil; - primary_thread.m_saved_last_thing_searched = Qnil; - primary_thread.name = Qnil; - primary_thread.function = Qnil; - primary_thread.error_symbol = Qnil; - primary_thread.error_data = Qnil; - primary_thread.event_object = Qnil; + XSETPVECTYPE (&main_thread, PVEC_THREAD); + main_thread.m_last_thing_searched = Qnil; + main_thread.m_saved_last_thing_searched = Qnil; + main_thread.name = Qnil; + main_thread.function = Qnil; + main_thread.error_symbol = Qnil; + main_thread.error_data = Qnil; + main_thread.event_object = Qnil; } bool -primary_thread_p (void *ptr) +main_thread_p (void *ptr) { - return (ptr == &primary_thread) ? true : false; + return ptr == &main_thread; } void init_threads_once (void) { - init_primary_thread (); + init_main_thread (); } void init_threads (void) { - init_primary_thread (); - sys_cond_init (&primary_thread.thread_condvar); + init_main_thread (); + sys_cond_init (&main_thread.thread_condvar); sys_mutex_init (&global_lock); sys_mutex_lock (&global_lock); - current_thread = &primary_thread; - primary_thread.thread_id = sys_thread_self (); + current_thread = &main_thread; + main_thread.thread_id = sys_thread_self (); } void |