1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Don't hold lock during scm_async_tick in readdir and ttyname

Only hold scm_i_misc_mutex while making the C calls.  This also avoids
the need for a dynamic-wind.  Add SCM_I_LOCKED_SYSCALL (similar to
SCM_SYSCALL) to handle the locking and EINTR loop.

libguile/filesys.c (scm_readdir): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/filesys.c (scm_ttyname): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/syscalls.h: add SCM_I_LOCKED_SYSCALL.
This commit is contained in:
Rob Browning 2025-01-22 12:55:06 -06:00
parent 4a6347c371
commit 63756efbc5
4 changed files with 44 additions and 45 deletions

2
NEWS
View file

@ -69,6 +69,8 @@ every line in a file.
** Immutable stringbufs are now 8-byte aligned on all systems
Previously they could end up with an alignment that violated the type
tag for their type (e.g. ending up tagged as immediates SCM_IMP()).
** `readdir` and `ttyname` now release scm_i_misc_mutex during asyncs
This avoids potential deadlocks.
Changes in 3.0.10 (since 3.0.9)