1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

locking on scm_c_read, scm_getc

* libguile/ports.c (scm_c_read_unlocked, scm_c_read, scm_getc_unlocked)
  (scm_getc): Split getc and read operations into locked and unlocked
  variants.  Change most uses to use the _unlocked version.
This commit is contained in:
Andy Wingo 2011-11-07 23:53:06 +01:00
parent 0d959103f9
commit be632904ca
6 changed files with 65 additions and 39 deletions

View file

@ -832,14 +832,14 @@ read_decimal_integer (SCM port, int c, ssize_t *resp)
if (c == '-')
{
sign = -1;
c = scm_getc (port);
c = scm_getc_unlocked (port);
}
while ('0' <= c && c <= '9')
{
res = 10*res + c-'0';
got_it = 1;
c = scm_getc (port);
c = scm_getc_unlocked (port);
}
if (got_it)
@ -870,7 +870,7 @@ scm_i_read_array (SCM port, int c)
*/
if (c == 'f')
{
c = scm_getc (port);
c = scm_getc_unlocked (port);
if (c != '3' && c != '6')
{
if (c != EOF)
@ -899,7 +899,7 @@ scm_i_read_array (SCM port, int c)
&& tag_len < sizeof tag_buf / sizeof tag_buf[0])
{
tag_buf[tag_len++] = c;
c = scm_getc (port);
c = scm_getc_unlocked (port);
}
if (tag_len == 0)
tag = SCM_BOOL_T;
@ -924,7 +924,7 @@ scm_i_read_array (SCM port, int c)
if (c == '@')
{
c = scm_getc (port);
c = scm_getc_unlocked (port);
c = read_decimal_integer (port, c, &lbnd);
}
@ -932,7 +932,7 @@ scm_i_read_array (SCM port, int c)
if (c == ':')
{
c = scm_getc (port);
c = scm_getc_unlocked (port);
c = read_decimal_integer (port, c, &len);
if (len < 0)
scm_i_input_error (NULL, port,