* src/thread.c (primary_thread_p): New function.
* src/alloc.c (mark_object): Use 'primary_thread_p' to bypass tests
meant for thread objects allocated dynamically.
* src/thread.h (primary_thread_p): Add prototype.
#ifdef GC_CHECK_MARKED_OBJECTS
m = mem_find (po);
- if (m == MEM_NIL && !SUBRP (obj) && !THREADP (obj))
+ if (m == MEM_NIL && !SUBRP (obj) && !primary_thread_p (po))
emacs_abort ();
#endif /* GC_CHECK_MARKED_OBJECTS */
if (pvectype != PVEC_SUBR
&& pvectype != PVEC_BUFFER
- && pvectype != PVEC_THREAD)
+ && !primary_thread_p (po))
CHECK_LIVE (live_vector_p);
switch (pvectype)
primary_thread.event_object = Qnil;
}
+bool
+primary_thread_p (void *ptr)
+{
+ return (ptr == &primary_thread) ? true : false;
+}
+
void
init_threads_once (void)
{
extern void init_threads_once (void);
extern void init_threads (void);
extern void syms_of_threads (void);
+extern bool primary_thread_p (void *);
typedef int select_func (int, fd_set *, fd_set *, fd_set *,
const struct timespec *, const sigset_t *);