summaryrefslogtreecommitdiff
path: root/libguile/ports.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-11-08 00:29:46 +0100
committerAndy Wingo <wingo@pobox.com>2011-11-08 00:55:01 +0100
commit4251ae2e282385be6d08b0fffab761fcc0fa93aa (patch)
tree1ed22a034053f088d63fa1c5bfd7f1dbb88a7043 /libguile/ports.h
parentc932ce0b559ceb7a14846241d7b1856c7c3eea3b (diff)
downloadguile-4251ae2e282385be6d08b0fffab761fcc0fa93aa.tar.gz
locking on port buffering operations
* libguile/ports.c (scm_fill_input_unlocked, scm_fill_input) (scm_end_input, scm_end_input_unlocked, scm_flush) (scm_flush_unlocked): Add locking and _unlocked variants. * libguile/filesys.c: * libguile/fports.c: * libguile/gdbint.c: * libguile/r6rs-ports.c: * libguile/read.c: * libguile/rw.c: Adapt callers to use _unlocked variants.
Diffstat (limited to 'libguile/ports.h')
-rw-r--r--libguile/ports.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/libguile/ports.h b/libguile/ports.h
index be6ea2932..2877ef60f 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -329,11 +329,14 @@ SCM_API SCM scm_unread_string (SCM str, SCM port);
/* Manipulating the buffers. */
SCM_API void scm_port_non_buffer (scm_t_port *pt);
SCM_API int scm_fill_input (SCM port);
+SCM_API int scm_fill_input_unlocked (SCM port);
SCM_INTERNAL size_t scm_take_from_input_buffers (SCM port, char *dest, size_t read_len);
SCM_API SCM scm_drain_input (SCM port);
SCM_API void scm_end_input (SCM port);
+SCM_API void scm_end_input_unlocked (SCM port);
SCM_API SCM scm_force_output (SCM port);
SCM_API void scm_flush (SCM port);
+SCM_API void scm_flush_unlocked (SCM port);
/* Output. */
SCM_INLINE void scm_putc (char c, SCM port);
@@ -419,7 +422,7 @@ scm_get_byte_or_eof_unlocked (SCM port)
if (pt->read_pos >= pt->read_end)
{
- if (SCM_UNLIKELY (scm_fill_input (port) == EOF))
+ if (SCM_UNLIKELY (scm_fill_input_unlocked (port) == EOF))
return EOF;
}
@@ -444,7 +447,7 @@ scm_peek_byte_or_eof_unlocked (SCM port)
if (pt->read_pos >= pt->read_end)
{
- if (SCM_UNLIKELY (scm_fill_input (port) == EOF))
+ if (SCM_UNLIKELY (scm_fill_input_unlocked (port) == EOF))
return EOF;
}