aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2016-12-30 13:42:38 -0800
committerPaul Eggert2016-12-30 13:43:24 -0800
commit108ef8033be79e9e5567002e85a316ecb5e77cad (patch)
tree5fd61d7c2a5e04f0b62402183f0b1ef7733112f3 /src
parent966d51592f07ad9de6afebcd828e667cce0f6a27 (diff)
downloademacs-108ef8033be79e9e5567002e85a316ecb5e77cad.tar.gz
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')
-rw-r--r--src/alloc.c4
-rw-r--r--src/thread.c40
-rw-r--r--src/thread.h2
-rw-r--r--src/w32.h2
4 files changed, 24 insertions, 24 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 121d7042353..d74c4bec7e2 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6404,7 +6404,7 @@ mark_object (Lisp_Object arg)
6404 6404
6405#ifdef GC_CHECK_MARKED_OBJECTS 6405#ifdef GC_CHECK_MARKED_OBJECTS
6406 m = mem_find (po); 6406 m = mem_find (po);
6407 if (m == MEM_NIL && !SUBRP (obj) && !primary_thread_p (po)) 6407 if (m == MEM_NIL && !SUBRP (obj) && !main_thread_p (po))
6408 emacs_abort (); 6408 emacs_abort ();
6409#endif /* GC_CHECK_MARKED_OBJECTS */ 6409#endif /* GC_CHECK_MARKED_OBJECTS */
6410 6410
@@ -6416,7 +6416,7 @@ mark_object (Lisp_Object arg)
6416 6416
6417 if (pvectype != PVEC_SUBR 6417 if (pvectype != PVEC_SUBR
6418 && pvectype != PVEC_BUFFER 6418 && pvectype != PVEC_BUFFER
6419 && !primary_thread_p (po)) 6419 && !main_thread_p (po))
6420 CHECK_LIVE (live_vector_p); 6420 CHECK_LIVE (live_vector_p);
6421 6421
6422 switch (pvectype) 6422 switch (pvectype)
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/>. */
26#include "coding.h" 26#include "coding.h"
27#include "syssignal.h" 27#include "syssignal.h"
28 28
29static struct thread_state primary_thread; 29static struct thread_state main_thread;
30 30
31struct thread_state *current_thread = &primary_thread; 31struct thread_state *current_thread = &main_thread;
32 32
33static struct thread_state *all_threads = &primary_thread; 33static struct thread_state *all_threads = &main_thread;
34 34
35static sys_mutex_t global_lock; 35static sys_mutex_t global_lock;
36 36
@@ -927,41 +927,41 @@ thread_check_current_buffer (struct buffer *buffer)
927 927
928 928
929static void 929static void
930init_primary_thread (void) 930init_main_thread (void)
931{ 931{
932 primary_thread.header.size 932 main_thread.header.size
933 = PSEUDOVECSIZE (struct thread_state, m_stack_bottom); 933 = PSEUDOVECSIZE (struct thread_state, m_stack_bottom);
934 XSETPVECTYPE (&primary_thread, PVEC_THREAD); 934 XSETPVECTYPE (&main_thread, PVEC_THREAD);
935 primary_thread.m_last_thing_searched = Qnil; 935 main_thread.m_last_thing_searched = Qnil;
936 primary_thread.m_saved_last_thing_searched = Qnil; 936 main_thread.m_saved_last_thing_searched = Qnil;
937 primary_thread.name = Qnil; 937 main_thread.name = Qnil;
938 primary_thread.function = Qnil; 938 main_thread.function = Qnil;
939 primary_thread.error_symbol = Qnil; 939 main_thread.error_symbol = Qnil;
940 primary_thread.error_data = Qnil; 940 main_thread.error_data = Qnil;
941 primary_thread.event_object = Qnil; 941 main_thread.event_object = Qnil;
942} 942}
943 943
944bool 944bool
945primary_thread_p (void *ptr) 945main_thread_p (void *ptr)
946{ 946{
947 return (ptr == &primary_thread) ? true : false; 947 return ptr == &main_thread;
948} 948}
949 949
950void 950void
951init_threads_once (void) 951init_threads_once (void)
952{ 952{
953 init_primary_thread (); 953 init_main_thread ();
954} 954}
955 955
956void 956void
957init_threads (void) 957init_threads (void)
958{ 958{
959 init_primary_thread (); 959 init_main_thread ();
960 sys_cond_init (&primary_thread.thread_condvar); 960 sys_cond_init (&main_thread.thread_condvar);
961 sys_mutex_init (&global_lock); 961 sys_mutex_init (&global_lock);
962 sys_mutex_lock (&global_lock); 962 sys_mutex_lock (&global_lock);
963 current_thread = &primary_thread; 963 current_thread = &main_thread;
964 primary_thread.thread_id = sys_thread_self (); 964 main_thread.thread_id = sys_thread_self ();
965} 965}
966 966
967void 967void
diff --git a/src/thread.h b/src/thread.h
index 9472ae30512..e6dc668f95a 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -285,7 +285,7 @@ extern void maybe_reacquire_global_lock (void);
285extern void init_threads_once (void); 285extern void init_threads_once (void);
286extern void init_threads (void); 286extern void init_threads (void);
287extern void syms_of_threads (void); 287extern void syms_of_threads (void);
288extern bool primary_thread_p (void *); 288extern bool main_thread_p (void *);
289 289
290typedef int select_func (int, fd_set *, fd_set *, fd_set *, 290typedef int select_func (int, fd_set *, fd_set *, fd_set *,
291 const struct timespec *, const sigset_t *); 291 const struct timespec *, const sigset_t *);
diff --git a/src/w32.h b/src/w32.h
index c73ff302c05..03dee099c01 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -89,7 +89,7 @@ typedef struct _child_process
89 terminate it by sys_kill. */ 89 terminate it by sys_kill. */
90 HWND hwnd; 90 HWND hwnd;
91 /* Information about subprocess returned by CreateProcess. Includes 91 /* Information about subprocess returned by CreateProcess. Includes
92 handles to the subprocess and its primary thread, and the 92 handles to the subprocess and its main thread, and the
93 corresponding process ID and thread ID numbers. The PID is 93 corresponding process ID and thread ID numbers. The PID is
94 mirrored by the 'pid' member above. The process handle is used 94 mirrored by the 'pid' member above. The process handle is used
95 to wait on it. */ 95 to wait on it. */