summaryrefslogtreecommitdiff
path: root/libguile/ioext.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-11-07 18:58:01 +0100
committerAndy Wingo <wingo@pobox.com>2011-11-07 18:58:01 +0100
commit62bd5d66cb66b695452887374c55d025b8b6efea (patch)
tree227dae36a713e1881a6f90a63dba9ec684f88fd0 /libguile/ioext.c
parenta535e9f54c35bb90bfa272ed040fe71825ce03dd (diff)
downloadguile-62bd5d66cb66b695452887374c55d025b8b6efea.tar.gz
threadsafe access to scm_ptobs
* libguile/ports.h (SCM_PORT_DESCRIPTOR): New macro, to get at a port descriptor in the third word of a port instead of looking it up in a table. (scm_c_port_type_ref, scm_c_port_type_add_x): New API for working with numbered ptob descriptors. (SCM_PTOBNAME): Implement in terms of scm_c_port_type_ref. (scm_get_byte_or_eof, scm_peek_byte_or_eof): Use SCM_PORT_DESCRIPTOR. * libguile/ports.c (scm_c_num_port_types, scm_c_port_type_ref) (scm_c_port_type_add_x, scm_make_port_type): Protect scm_ptobs access with a mutex. Have it be an array of pointers instead of an array of structures. Adapt users to the new APIs. (scm_c_make_port_with_encoding): Allocate ports with three words. The third word is the ptob descriptor. * libguile/backtrace.c: * libguile/goops.c: * libguile/ioext.c: * libguile/print.c: Adapt to use scm_c_port_type_ref and SCM_PORT_DESCRIPTOR.
Diffstat (limited to 'libguile/ioext.c')
-rw-r--r--libguile/ioext.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libguile/ioext.c b/libguile/ioext.c
index cb55fb2c3..f2b1d6d4c 100644
--- a/libguile/ioext.c
+++ b/libguile/ioext.c
@@ -89,7 +89,7 @@ SCM_DEFINE (scm_redirect_port, "redirect-port", 2, 0, 0,
{
scm_t_port *pt = SCM_PTAB_ENTRY (new);
scm_t_port *old_pt = SCM_PTAB_ENTRY (old);
- scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (new)];
+ scm_t_ptob_descriptor *ptob = SCM_PORT_DESCRIPTOR (new);
/* must flush to old fdes. */
if (pt->rw_active == SCM_PORT_WRITE)