don't take string-write mutex in read.c:read_token
authorAndy Wingo <wingo@pobox.com>
Mon, 21 Dec 2009 21:12:31 +0000 (22:12 +0100)
committerAndy Wingo <wingo@pobox.com>
Mon, 21 Dec 2009 21:12:31 +0000 (22:12 +0100)
* libguile/read.c (read_token): Don't take the string-write mutex when
  reading a token into a buffer, because it's assumed that the buffer is
  fresh (not seen by other threads), and a soft port can call a
  procedure that needs the string-write mutex.

libguile/read.c

index 6388084..da4a174 100644 (file)
@@ -195,7 +195,6 @@ read_token (SCM port, SCM buf, size_t *read)
   scm_t_wchar chr;
   *read = 0;
 
-  buf = scm_i_string_start_writing (buf);
   while (*read < scm_i_string_length (buf))
     {
       chr = scm_getc (port);
@@ -218,7 +217,6 @@ read_token (SCM port, SCM buf, size_t *read)
       scm_i_string_set_x (buf, *read, chr);
       (*read)++;
     }
-  scm_i_string_stop_writing ();
 
   return 1;
 }