aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
authorTom Tromey2012-08-15 13:07:04 -0600
committerTom Tromey2012-08-15 13:07:04 -0600
commit60a9d2a7728895c1a5bfbc37c3bfa8fde35abe61 (patch)
tree8cecdc7d91f6eb803ce132c4667052de465f9177 /src/thread.c
parente160922c665ba65e1dba5b87a924927e61be43b9 (diff)
downloademacs-60a9d2a7728895c1a5bfbc37c3bfa8fde35abe61.tar.gz
emacs-60a9d2a7728895c1a5bfbc37c3bfa8fde35abe61.zip
This turns thread_state into a pseudovector and updates various bits
of Emacs to cope.
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/thread.c b/src/thread.c
index 605a52cb2f9..7d2f81ec9ce 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -32,7 +32,7 @@ sys_mutex_t global_lock;
32static void 32static void
33mark_one_thread (struct thread_state *thread) 33mark_one_thread (struct thread_state *thread)
34{ 34{
35 register struct specbinding *bind; 35 struct specbinding *bind;
36 struct handler *handler; 36 struct handler *handler;
37 Lisp_Object tem; 37 Lisp_Object tem;
38 38
@@ -48,7 +48,7 @@ mark_one_thread (struct thread_state *thread)
48 mark_stack (thread->m_stack_bottom, thread->stack_top); 48 mark_stack (thread->m_stack_bottom, thread->stack_top);
49#else 49#else
50 { 50 {
51 register struct gcpro *tail; 51 struct gcpro *tail;
52 for (tail = thread->m_gcprolist; tail; tail = tail->next) 52 for (tail = thread->m_gcprolist; tail; tail = tail->next)
53 for (i = 0; i < tail->nvars; i++) 53 for (i = 0; i < tail->nvars; i++)
54 mark_object (tail->var[i]); 54 mark_object (tail->var[i]);
@@ -88,7 +88,13 @@ mark_threads_callback (void *ignore)
88 struct thread_state *iter; 88 struct thread_state *iter;
89 89
90 for (iter = all_threads; iter; iter = iter->next_thread) 90 for (iter = all_threads; iter; iter = iter->next_thread)
91 mark_one_thread (iter); 91 {
92 Lisp_Object thread_obj;
93
94 XSETTHREAD (thread_obj, iter);
95 mark_object (thread_obj);
96 mark_one_thread (iter);
97 }
92} 98}
93 99
94void 100void
@@ -108,6 +114,16 @@ unmark_threads (void)
108} 114}
109 115
110void 116void
117init_threads_once (void)
118{
119 the_only_thread.header.size
120 = PSEUDOVECSIZE (struct thread_state, m_gcprolist);
121 XSETPVECTYPE (&the_only_thread, PVEC_THREAD);
122 the_only_thread.m_last_thing_searched = Qnil;
123 the_only_thread.m_saved_last_thing_searched = Qnil;
124}
125
126void
111init_threads (void) 127init_threads (void)
112{ 128{
113 sys_mutex_init (&global_lock); 129 sys_mutex_init (&global_lock);