1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-28 16:00:22 +02:00

* iselect.c (coop_next_runnable_thread,

coop_wait_for_runnable_thread): Disable interrupts so that no
async is executed before a potential error_revive.
(scm_internal_select): Disable interrupts during the parts of the
code which manipulate the sleep queue and the file descriptors.
This commit is contained in:
Mikael Djurfeldt 1997-11-28 01:11:12 +00:00
parent 81e81a5cb7
commit c718cb0702
2 changed files with 9 additions and 0 deletions

View file

@ -3,6 +3,8 @@
* iselect.c (coop_next_runnable_thread,
coop_wait_for_runnable_thread): Disable interrupts so that no
async is executed before a potential error_revive.
(scm_internal_select): Disable interrupts during the parts of the
code which manipulate the sleep queue and the file descriptors.
1997-11-27 Mikael Djurfeldt <mdj@mdj.nada.kth.se>

View file

@ -524,10 +524,14 @@ scm_internal_select (int nfds,
&& timeout->tv_usec == 0)
return select (nfds, readfds, writefds, exceptfds, timeout);
++scm_ints_disabled;
/* Add our file descriptor flags to the common set. */
if (add_fd_sets (nfds, readfds, writefds, exceptfds))
{
errno = EBADF; /* Several threads can't select on same fds. */
if (!--scm_ints_disabled)
SCM_ASYNC_TICK;
return -1;
}
@ -554,6 +558,9 @@ scm_internal_select (int nfds,
t = coop_wait_for_runnable_thread_now (&now);
}
if (!--scm_ints_disabled)
SCM_ASYNC_TICK;
/* If the new thread is the same as the sleeping thread, do nothing */
if (t != curr)
{