1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-19 02:00:26 +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, 2002 Free Software Foundation, Inc.
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 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
@ -199,6 +199,8 @@ scm_evict_ports (int fd)
{
long i;
scm_mutex_lock (&scm_i_port_table_mutex);
for (i = 0; i < scm_i_port_table_size; i++)
{
SCM port = scm_i_port_table[i]->port;
@ -216,6 +218,8 @@ scm_evict_ports (int fd)
}
}
}
scm_mutex_unlock (&scm_i_port_table_mutex);
}
@ -415,7 +419,7 @@ scm_fdes_to_port (int fdes, char *mode, SCM name)
SCM_MISC_ERROR ("requested file mode not available on fdes", SCM_EOL);
}
SCM_DEFER_INTS;
scm_mutex_lock (&scm_i_port_table_mutex);
port = scm_new_port_table_entry (scm_tc16_fport);
SCM_SET_CELL_TYPE(port, scm_tc16_fport | mode_bits);
@ -433,7 +437,7 @@ scm_fdes_to_port (int fdes, char *mode, SCM name)
scm_fport_buffer_add (port, -1, -1);
}
SCM_SET_FILENAME (port, name);
SCM_ALLOW_INTS;
scm_mutex_unlock (&scm_i_port_table_mutex);
return port;
}
#undef FUNC_NAME