summaryrefslogtreecommitdiff
path: root/libguile/ioext.c
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>2003-04-24 16:02:04 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>2003-04-24 16:02:04 +0000
commitb9ad392e86906ef5eba54cb4219014d48356c3cc (patch)
treec1f800c5305f5e54ebc2d7a809a49757238575a9 /libguile/ioext.c
parent359aab2498abacee8b2aadbe504059389fd72e34 (diff)
downloadguile-b9ad392e86906ef5eba54cb4219014d48356c3cc.tar.gz
* 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.
Diffstat (limited to 'libguile/ioext.c')
-rw-r--r--libguile/ioext.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libguile/ioext.c b/libguile/ioext.c
index a91ac6fb2..66e32cb91 100644
--- a/libguile/ioext.c
+++ b/libguile/ioext.c
@@ -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