diff options
author | Andy Wingo <wingo@pobox.com> | 2012-02-23 14:18:52 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-02-23 14:18:52 +0100 |
commit | bab917c9a37d8f69ccd9af1d5c37a53637fd0fdf (patch) | |
tree | 5d1575c074b5fb047bafc822b3593b6ece1da95d /libguile/strings.c | |
parent | 9d15db65ffd49fd8fda77dcb6b70c3c930ae5153 (diff) | |
download | guile-bab917c9a37d8f69ccd9af1d5c37a53637fd0fdf.tar.gz |
Revert "wrap iconv_open / iconv_close with a lock to help in thread/fork issues"
This reverts commit 8dfb7bbfd908ca883d0fdd0d868e13e6b20803ae.
Diffstat (limited to 'libguile/strings.c')
-rw-r--r-- | libguile/strings.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/libguile/strings.c b/libguile/strings.c index 977548b74..c2edcd70a 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -225,25 +225,9 @@ narrow_stringbuf (SCM buf) return new_buf; } - - scm_i_pthread_mutex_t stringbuf_write_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER; SCM_PTHREAD_ATFORK_LOCK_STATIC_MUTEX (stringbuf_write_mutex); -static scm_i_pthread_mutex_t iconv_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER; - -void -scm_i_lock_iconv (void) -{ - scm_i_pthread_mutex_lock (&iconv_mutex); -} - -void -scm_i_unlock_iconv (void) -{ - scm_i_pthread_mutex_unlock (&iconv_mutex); -} - /* Copy-on-write strings. */ @@ -1547,14 +1531,12 @@ scm_from_stringn (const char *str, size_t len, const char *encoding, return scm_from_utf8_stringn (str, len); u32len = 0; - scm_i_lock_iconv (); u32 = (scm_t_wchar *) u32_conv_from_encoding (encoding, (enum iconv_ilseq_handler) handler, str, len, NULL, NULL, &u32len); - scm_i_unlock_iconv (); if (SCM_UNLIKELY (u32 == NULL)) decoding_error (__func__, errno, str, len); @@ -2089,12 +2071,10 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding, enc = "ISO-8859-1"; if (scm_i_is_narrow_string (str)) { - scm_i_lock_iconv (); ret = mem_iconveh (scm_i_string_chars (str), ilen, "ISO-8859-1", enc, (enum iconv_ilseq_handler) handler, NULL, &buf, &len); - scm_i_unlock_iconv (); if (ret != 0) scm_encoding_error (__func__, errno, @@ -2105,14 +2085,12 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding, } else { - scm_i_lock_iconv (); buf = u32_conv_to_encoding (enc, (enum iconv_ilseq_handler) handler, (scm_t_uint32 *) scm_i_string_wide_chars (str), ilen, NULL, NULL, &len); - scm_i_unlock_iconv (); if (buf == NULL) scm_encoding_error (__func__, errno, "cannot convert wide string to output locale", @@ -2356,9 +2334,6 @@ scm_init_strings () { scm_nullstr = scm_i_make_string (0, NULL, 0); - scm_i_pthread_atfork (scm_i_lock_iconv, scm_i_unlock_iconv, - scm_i_unlock_iconv); - #include "libguile/strings.x" } |