1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

* ports.c, ports.h (scm_i_port_table_mutex): New mutex.

* fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex.

* ports.c (scm_close_port, scm_flush_all_ports): Ditto.

* ioext.c (scm_fdes_to_ports): Ditto.

* vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into
lock/unlock scm_i_port_table_mutex.

* strports.c (scm_mkstrport): Ditto.

* ports.c (scm_void_port, scm_port_for_each): Ditto.

* fports.c (scm_fdes_to_port): Ditto.
This commit is contained in:
Mikael Djurfeldt 2003-04-24 16:02:04 +00:00
parent 359aab2498
commit b9ad392e86
7 changed files with 53 additions and 19 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -282,12 +282,14 @@ SCM_DEFINE (scm_fdes_to_ports, "fdes->ports", 1, 0, 0,
SCM_VALIDATE_INUM_COPY (1, fd, int_fd);
scm_mutex_lock (&scm_i_port_table_mutex);
for (i = 0; i < scm_i_port_table_size; i++)
{
if (SCM_OPFPORTP (scm_i_port_table[i]->port)
&& ((scm_t_fport *) scm_i_port_table[i]->stream)->fdes == int_fd)
result = scm_cons (scm_i_port_table[i]->port, result);
}
scm_mutex_unlock (&scm_i_port_table_mutex);
return result;
}
#undef FUNC_NAME