diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2003-04-24 16:02:04 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2003-04-24 16:02:04 +0000 |
commit | b9ad392e86906ef5eba54cb4219014d48356c3cc (patch) | |
tree | c1f800c5305f5e54ebc2d7a809a49757238575a9 /libguile/fports.c | |
parent | 359aab2498abacee8b2aadbe504059389fd72e34 (diff) | |
download | guile-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/fports.c')
-rw-r--r-- | libguile/fports.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libguile/fports.c b/libguile/fports.c index 392a92df3..078135a8c 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -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 |