* src/thread.c (unmark_main_thread): New function.
* src/lisp.h (unmark_main_thread): Prototype it.
* src/alloc.c (garbage_collect_1): Call it after sweeping.
(Bug#33073)
* test/src/thread-tests.el (threads-test-bug33073): New test.
VECTOR_UNMARK (&buffer_defaults);
VECTOR_UNMARK (&buffer_local_symbols);
+ unmark_main_thread ();
+
check_cons_list ();
gc_in_progress = 0;
/* Defined in thread.c. */
extern void mark_threads (void);
+extern void unmark_main_thread (void);
/* Defined in editfns.c. */
extern void insert1 (Lisp_Object);
flush_stack_call_func (mark_threads_callback, NULL);
}
+void
+unmark_main_thread (void)
+{
+ main_thread.header.size &= ~ARRAY_MARK_FLAG;
+}
+
\f
static void
(should (= (length (all-threads)) 1))
(should (equal (thread-last-error) '(error "Die, die, die!")))))
+(ert-deftest threads-test-bug33073 ()
+ (let ((th (make-thread 'ignore)))
+ (should-not (equal th main-thread))))
+
;;; threads.el ends here