<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/thread.h, branch feature/igc</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Merge branch 'master' into feature/igc</title>
<updated>2026-01-02T20:01:55+00:00</updated>
<author>
<name>Helmut Eller</name>
</author>
<published>2026-01-02T20:01:55+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=e049ec683d3e504e2ae36b37500405b37a162786'/>
<id>e049ec683d3e504e2ae36b37500405b37a162786</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>; Add 2026 to copyright years.</title>
<updated>2026-01-01T12:54:34+00:00</updated>
<author>
<name>Sean Whitton</name>
</author>
<published>2026-01-01T12:54:34+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c31f6adc31d48076c63ad82b83b2970e1b0d7b9b'/>
<id>c31f6adc31d48076c63ad82b83b2970e1b0d7b9b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Also put sys_cond_t variables in ordinary memory</title>
<updated>2025-10-18T13:29:52+00:00</updated>
<author>
<name>Pip Cet</name>
</author>
<published>2025-10-18T13:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=f42173775dca62fc292d2c549d884f233e2c4210'/>
<id>f42173775dca62fc292d2c549d884f233e2c4210</id>
<content type='text'>
* src/thread.c (lisp_mutex_init) [MPS]: Allocate condition variable.
(lisp_mutex_lock_for_thread):
(lisp_mutex_unlock):
(lisp_mutex_unlock_for_wait): Adjust to pointer type.
(lisp_mutex_destroy) [MPS]: Also free condition variable.
(Fmake_condition_variable) [MPS]: Allocate condition variable.
(condition_wait_callback):
(condition_notify_callback): Adjust to pointer type.
(finalize_one_condvar) [MPS]: Also free condition variable.
* src/thread.h (lisp_mutex_t, struct Lisp_CondVar): Make 'condition'
and 'cond' a pointer or single-element array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/thread.c (lisp_mutex_init) [MPS]: Allocate condition variable.
(lisp_mutex_lock_for_thread):
(lisp_mutex_unlock):
(lisp_mutex_unlock_for_wait): Adjust to pointer type.
(lisp_mutex_destroy) [MPS]: Also free condition variable.
(Fmake_condition_variable) [MPS]: Allocate condition variable.
(condition_wait_callback):
(condition_notify_callback): Adjust to pointer type.
(finalize_one_condvar) [MPS]: Also free condition variable.
* src/thread.h (lisp_mutex_t, struct Lisp_CondVar): Make 'condition'
and 'cond' a pointer or single-element array.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix crashes when threads are put behind a barrier</title>
<updated>2025-10-18T13:12:13+00:00</updated>
<author>
<name>Pip Cet</name>
</author>
<published>2025-10-18T13:12:13+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7e0b82481aabbb46208b562bd1ecfa7e48612ce8'/>
<id>7e0b82481aabbb46208b562bd1ecfa7e48612ce8</id>
<content type='text'>
On GNU/Linux, glibc expects condvars and mutexes to be in memory which
is always accessible.

* src/thread.c (main_thread_condvar): New variable.
(main_thread): Add reference to it.
(run_thread): Adjust.
(finalize_one_thread) [MPS]: Free 'thread_condvar'.
(Fmake_thread) [MPS]: Allocate 'thread_condvar'.
(thread_join_callback):
(init_threads): Adjust.
* src/thread.h (struct thread_state): Turn 'thread_condvar' into a
pointer or single-element array.
* test/src/igc-tests.el (igc-test--list-length): New variable.
(igc-test--trigger-incremental-gc): New function.
(igc-test-thread-incremental-gc): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On GNU/Linux, glibc expects condvars and mutexes to be in memory which
is always accessible.

* src/thread.c (main_thread_condvar): New variable.
(main_thread): Add reference to it.
(run_thread): Adjust.
(finalize_one_thread) [MPS]: Free 'thread_condvar'.
(Fmake_thread) [MPS]: Allocate 'thread_condvar'.
(thread_join_callback):
(init_threads): Adjust.
* src/thread.h (struct thread_state): Turn 'thread_condvar' into a
pointer or single-element array.
* test/src/igc-tests.el (igc-test--list-length): New variable.
(igc-test--trigger-incremental-gc): New function.
(igc-test-thread-incremental-gc): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>[MPS] Use xmalloc to allocate 'bc_thread_state' struct</title>
<updated>2025-10-13T18:25:19+00:00</updated>
<author>
<name>Pip Cet</name>
</author>
<published>2025-10-13T18:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c6475fa2f20e92a32453272a547367232a1e3e83'/>
<id>c6475fa2f20e92a32453272a547367232a1e3e83</id>
<content type='text'>
This struct cannot live in MPS-managed memory because it's required
for scanning the bytecode stack.

* src/bytecode.c (free_bc_thread) [MPS]: Free bytecode structure.
(Finternal_stack_stats, exec_byte_code):
* src/igc.c (scan_bc): Adjust.
(root_create_bc): Save 'bc' pointer.
* src/lisp.h (get_act_rec, set_act_rec):
* src/thread.c (mark_one_thread, finalize_one_thread): Adjust.
(Fmake_thread) [MPS]:
(init_threads) [MPS]: Allocate bytecode structure.
* src/thread.h (struct thread_state): Turn 'bc' member into a
pointer (MPS) or single-member array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This struct cannot live in MPS-managed memory because it's required
for scanning the bytecode stack.

* src/bytecode.c (free_bc_thread) [MPS]: Free bytecode structure.
(Finternal_stack_stats, exec_byte_code):
* src/igc.c (scan_bc): Adjust.
(root_create_bc): Save 'bc' pointer.
* src/lisp.h (get_act_rec, set_act_rec):
* src/thread.c (mark_one_thread, finalize_one_thread): Adjust.
(Fmake_thread) [MPS]:
(init_threads) [MPS]: Allocate bytecode structure.
* src/thread.h (struct thread_state): Turn 'bc' member into a
pointer (MPS) or single-member array.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace AMS pool for immovable objects (bug#79584)</title>
<updated>2025-10-13T03:22:22+00:00</updated>
<author>
<name>Gerd Möllmann</name>
</author>
<published>2025-10-09T10:32:51+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=9083010dc4523a0d838dc0402956d81c8193e406'/>
<id>9083010dc4523a0d838dc0402956d81c8193e406</id>
<content type='text'>
This replaces the AMS pool with an AMC pool + pinning.

* src/igc.c (struct igc_pins): New.
(struct igc): Add member pins.
(pin, unpin, amke_pins, count_pins, enlarge_pins): New
functions.
(make_fake_entry_pins): New function.
(Figc_info): Use make_fake_entry_pins.
(igc_thread_remove): Unpin thread_state.
(igc_alloc_global_ref): Pin allocated global ref.
(igc_free_global_ref): New function.
(make_pool_ams): Remove.
(make_igc): Make immovable pool and AMC pool.
* src/igc.h (igc_free_global_ref): Declare.
* src/emacs-module.c (module_free_global_ref): Call
igc_free_global_ref.
* src/lisp.h (struct thread_state): Add member pin_index.
* src/thread.h (GCALIGNED_STRUCT): Add member pin_index.
* src/igc.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This replaces the AMS pool with an AMC pool + pinning.

* src/igc.c (struct igc_pins): New.
(struct igc): Add member pins.
(pin, unpin, amke_pins, count_pins, enlarge_pins): New
functions.
(make_fake_entry_pins): New function.
(Figc_info): Use make_fake_entry_pins.
(igc_thread_remove): Unpin thread_state.
(igc_alloc_global_ref): Pin allocated global ref.
(igc_free_global_ref): New function.
(make_pool_ams): Remove.
(make_igc): Make immovable pool and AMC pool.
* src/igc.h (igc_free_global_ref): Declare.
* src/emacs-module.c (module_free_global_ref): Call
igc_free_global_ref.
* src/lisp.h (struct thread_state): Add member pin_index.
* src/thread.h (GCALIGNED_STRUCT): Add member pin_index.
* src/igc.c
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' into feature/igc</title>
<updated>2025-08-24T10:15:10+00:00</updated>
<author>
<name>Gerd Möllmann</name>
</author>
<published>2025-08-24T10:15:10+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7d7ecea0eb3aaaee30aad76689d3b42ee25b5082'/>
<id>7d7ecea0eb3aaaee30aad76689d3b42ee25b5082</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow thread's buffer to be killed, by default</title>
<updated>2025-08-09T19:40:07+00:00</updated>
<author>
<name>Dmitry Gutov</name>
</author>
<published>2025-08-09T19:40:07+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=07eb39f1132ceb15e80e7912445890faa8f5b78c'/>
<id>07eb39f1132ceb15e80e7912445890faa8f5b78c</id>
<content type='text'>
* src/thread.c (Fmake_thread): Add new argument (bug#76969).
(thread_set_error): New function, extracted from thread-signal.
(Fthread_buffer_disposition): Add getter.
(Fthread_set_buffer_disposition): And setter.
(thread_check_current_buffer): Check the values of threads'
buffer_disposition.
(thread_all_before_buffer_killed): New function.
(init_threads): Set buffer_disposition to nil for the main thread.
(syms_of_threads): Add new symbols and define the error.

* src/thread.h (thread_state): New field buffer_disposition.
(thread_all_before_buffer_killed): Declare.

* src/buffer.c (Fkill_buffer): Call thread_check_current_buffer
one more time after all hooks and after that call
thread_all_before_buffer_killed.

* src/comp.c (ABI_VERSION): Increase the value.

* test/src/thread-tests.el (thread-buffer-disposition-t)
(thread-buffer-disposition-nil)
(thread-buffer-disposition-silently)
(thread-set-buffer-disposition)
(thread-set-buffer-disposition-main-thread): New tests.

* doc/lispref/threads.texi (Basic Thread Functions): Document
buffer-disposition in make-thread and its getter and setter.

* etc/NEWS: Add entry.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/thread.c (Fmake_thread): Add new argument (bug#76969).
(thread_set_error): New function, extracted from thread-signal.
(Fthread_buffer_disposition): Add getter.
(Fthread_set_buffer_disposition): And setter.
(thread_check_current_buffer): Check the values of threads'
buffer_disposition.
(thread_all_before_buffer_killed): New function.
(init_threads): Set buffer_disposition to nil for the main thread.
(syms_of_threads): Add new symbols and define the error.

* src/thread.h (thread_state): New field buffer_disposition.
(thread_all_before_buffer_killed): Declare.

* src/buffer.c (Fkill_buffer): Call thread_check_current_buffer
one more time after all hooks and after that call
thread_all_before_buffer_killed.

* src/comp.c (ABI_VERSION): Increase the value.

* test/src/thread-tests.el (thread-buffer-disposition-t)
(thread-buffer-disposition-nil)
(thread-buffer-disposition-silently)
(thread-set-buffer-disposition)
(thread-set-buffer-disposition-main-thread): New tests.

* doc/lispref/threads.texi (Basic Thread Functions): Document
buffer-disposition in make-thread and its getter and setter.

* etc/NEWS: Add entry.
</pre>
</div>
</content>
</entry>
<entry>
<title>[MPS] Scan thread-&gt;m_getcjmp ambigously</title>
<updated>2025-05-01T13:04:19+00:00</updated>
<author>
<name>Pip Cet</name>
</author>
<published>2025-04-24T12:28:54+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7f87f642ebcdf48056b4a5781bd81042f7f00acf'/>
<id>7f87f642ebcdf48056b4a5781bd81042f7f00acf</id>
<content type='text'>
This makes it necessary to allocate the buffer indirectly, as it needs
to be an MPS root rather than part of a normal pseudovector.

* src/thread.c (main_thread_getcjmp): New variable.
(main_thread): Use it.
(run_thread): Free setjmp buffer when tearing down a thread.
(Fmake_thread): Allocate setjmp buffer when starting a new thread.
* src/thread.h (m_getcjmp): Point to sys_jmp_buf indirectly.
* src/igc.c (root_create_main_thread): Create an ambiguous root for
'main_thread_getjmp'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it necessary to allocate the buffer indirectly, as it needs
to be an MPS root rather than part of a normal pseudovector.

* src/thread.c (main_thread_getcjmp): New variable.
(main_thread): Use it.
(run_thread): Free setjmp buffer when tearing down a thread.
(Fmake_thread): Allocate setjmp buffer when starting a new thread.
* src/thread.h (m_getcjmp): Point to sys_jmp_buf indirectly.
* src/igc.c (root_create_main_thread): Create an ambiguous root for
'main_thread_getjmp'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' into scratch/igc</title>
<updated>2025-01-08T03:04:49+00:00</updated>
<author>
<name>Gerd Möllmann</name>
</author>
<published>2025-01-08T03:04:49+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=2838be3fd554cf5965967e873a52c1e69363f170'/>
<id>2838be3fd554cf5965967e873a52c1e69363f170</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
