diff options
author | Andy Wingo <wingo@pobox.com> | 2011-11-08 00:36:48 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-11-08 00:55:05 +0100 |
commit | 0607ebbfcf63dc81e4bc2b10f3a8c3bc0d348c09 (patch) | |
tree | 8d7b9e0b211acf00ebcd43e57b7a860fa966ea07 | |
parent | 4251ae2e282385be6d08b0fffab761fcc0fa93aa (diff) |
locking for putc, puts
* libguile/ports.c (scm_putc, scm_puts):
* libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into
_unlocked and locked variants. Change all callers to use the
_unlocked versions.
44 files changed, 233 insertions, 215 deletions
diff --git a/libguile/arbiters.c b/libguile/arbiters.c index 5923c718a..831e0a230 100644 --- a/libguile/arbiters.c +++ b/libguile/arbiters.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996, 1997, 2000, 2001, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997, 2000, 2001, 2004, 2005, 2006, 2008, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -89,11 +89,11 @@ static scm_t_bits scm_tc16_arbiter; static int arbiter_print (SCM exp, SCM port, scm_print_state *pstate) { - scm_puts ("#<arbiter ", port); + scm_puts_unlocked ("#<arbiter ", port); if (SCM_ARB_LOCKED (exp)) - scm_puts ("locked ", port); + scm_puts_unlocked ("locked ", port); scm_iprin1 (SCM_PACK (SCM_SMOB_DATA (exp)), port, pstate); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return !0; } diff --git a/libguile/arrays.c b/libguile/arrays.c index 05ddf87e0..bcc351cb1 100644 --- a/libguile/arrays.c +++ b/libguile/arrays.c @@ -727,15 +727,15 @@ scm_i_print_array_dimension (scm_t_array_handle *h, int dim, int pos, else { ssize_t i; - scm_putc ('(', port); + scm_putc_unlocked ('(', port); for (i = h->dims[dim].lbnd; i <= h->dims[dim].ubnd; i++, pos += h->dims[dim].inc) { scm_i_print_array_dimension (h, dim+1, pos, port, pstate); if (i < h->dims[dim].ubnd) - scm_putc (' ', port); + scm_putc_unlocked (' ', port); } - scm_putc (')', port); + scm_putc_unlocked (')', port); } return 1; } @@ -752,7 +752,7 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate) scm_array_get_handle (array, &h); - scm_putc ('#', port); + scm_putc_unlocked ('#', port); if (h.ndims != 1 || h.dims[0].lbnd != 0) scm_intprint (h.ndims, 10, port); if (h.element_type != SCM_ARRAY_ELEMENT_TYPE_SCM) @@ -773,12 +773,12 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate) { if (print_lbnds) { - scm_putc ('@', port); + scm_putc_unlocked ('@', port); scm_intprint (h.dims[i].lbnd, 10, port); } if (print_lens) { - scm_putc (':', port); + scm_putc_unlocked (':', port); scm_intprint (h.dims[i].ubnd - h.dims[i].lbnd + 1, 10, port); } @@ -806,9 +806,9 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate) not really the same as Scheme values since they are boxed and can be modified with array-set!, say. */ - scm_putc ('(', port); + scm_putc_unlocked ('(', port); scm_i_print_array_dimension (&h, 0, 0, port, pstate); - scm_putc (')', port); + scm_putc_unlocked (')', port); return 1; } else diff --git a/libguile/backtrace.c b/libguile/backtrace.c index 4dacae2b6..351e600a1 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -59,9 +59,9 @@ static SCM boot_print_exception (SCM port, SCM frame, SCM key, SCM args) #define FUNC_NAME "boot-print-exception" { - scm_puts ("Throw to key ", port); + scm_puts_unlocked ("Throw to key ", port); scm_write (key, port); - scm_puts (" with args ", port); + scm_puts_unlocked (" with args ", port); scm_write (args, port); return SCM_UNSPECIFIED; } @@ -207,7 +207,7 @@ indent (int n, SCM port) { int i; for (i = 0; i < n; ++i) - scm_putc (' ', port); + scm_putc_unlocked (' ', port); } static void @@ -223,7 +223,7 @@ display_frame_expr (char *hdr, SCM exp, char *tlr, int indentation, SCM sport, S { pstate->level = print_params[i].level - 1; scm_iprlist (hdr, exp, tlr[0], sport, pstate); - scm_puts (&tlr[1], sport); + scm_puts_unlocked (&tlr[1], sport); } else { @@ -328,19 +328,19 @@ display_backtrace_file (frame, last_file, port, pstate) *last_file = file; - scm_puts ("In ", port); + scm_puts_unlocked ("In ", port); if (scm_is_false (file)) if (scm_is_false (line)) - scm_puts ("unknown file", port); + scm_puts_unlocked ("unknown file", port); else - scm_puts ("current input", port); + scm_puts_unlocked ("current input", port); else { pstate->writingp = 0; scm_iprin1 (file, port, pstate); pstate->writingp = 1; } - scm_puts (":\n", port); + scm_puts_unlocked (":\n", port); } static void @@ -355,9 +355,9 @@ display_backtrace_file_and_line (SCM frame, SCM port, scm_print_state *pstate) if (scm_is_false (file)) { if (scm_is_false (line)) - scm_putc ('?', port); + scm_putc_unlocked ('?', port); else - scm_puts ("<stdin>", port); + scm_puts_unlocked ("<stdin>", port); } else { @@ -372,7 +372,7 @@ display_backtrace_file_and_line (SCM frame, SCM port, scm_print_state *pstate) pstate -> writingp = 1; } - scm_putc (':', port); + scm_putc_unlocked (':', port); } else if (scm_is_true (line)) { @@ -383,10 +383,10 @@ display_backtrace_file_and_line (SCM frame, SCM port, scm_print_state *pstate) } if (scm_is_false (line)) - scm_puts (" ?", port); + scm_puts_unlocked (" ?", port); else scm_intprint (scm_to_int (line) + 1, 10, port); - scm_puts (": ", port); + scm_puts_unlocked (": ", port); } static void @@ -413,7 +413,7 @@ display_frame (SCM frame, int n, int nfield, int indentation, /* Display an application. */ display_application (frame, nfield + 1 + indentation, sport, port, pstate); - scm_putc ('\n', port); + scm_putc_unlocked ('\n', port); } struct display_backtrace_args { @@ -513,7 +513,7 @@ error_during_backtrace (void *data, SCM tag, SCM throw_args) { SCM port = SCM_PACK_POINTER (data); - scm_puts ("Exception thrown while printing backtrace:\n", port); + scm_puts_unlocked ("Exception thrown while printing backtrace:\n", port); scm_print_exception (port, SCM_BOOL_F, tag, throw_args); return SCM_UNSPECIFIED; @@ -574,7 +574,7 @@ SCM_DEFINE (scm_backtrace_with_highlights, "backtrace", 0, 1, 0, highlights = SCM_EOL; scm_newline (port); - scm_puts ("Backtrace:\n", port); + scm_puts_unlocked ("Backtrace:\n", port); scm_display_backtrace_with_highlights (stack, port, SCM_BOOL_F, SCM_BOOL_F, highlights); scm_newline (port); diff --git a/libguile/bitvectors.c b/libguile/bitvectors.c index 17b026009..12dd13637 100644 --- a/libguile/bitvectors.c +++ b/libguile/bitvectors.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003,2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003,2004, 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -53,12 +53,12 @@ bitvector_print (SCM vec, SCM port, scm_print_state *pstate) scm_t_uint32 *bits = BITVECTOR_BITS (vec); size_t i, j; - scm_puts ("#*", port); + scm_puts_unlocked ("#*", port); for (i = 0; i < word_len; i++, bit_len -= 32) { scm_t_uint32 mask = 1; for (j = 0; j < 32 && j < bit_len; j++, mask <<= 1) - scm_putc ((bits[i] & mask)? '1' : '0', port); + scm_putc_unlocked ((bits[i] & mask)? '1' : '0', port); } return 1; diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c index 9999b23e4..17ad4429f 100644 --- a/libguile/bytevectors.c +++ b/libguile/bytevectors.c @@ -415,17 +415,17 @@ scm_i_print_bytevector (SCM bv, SCM port, scm_print_state *pstate SCM_UNUSED) scm_array_get_handle (bv, &h); - scm_putc ('#', port); + scm_putc_unlocked ('#', port); scm_write (scm_array_handle_element_type (&h), port); - scm_putc ('(', port); + scm_putc_unlocked ('(', port); for (i = h.dims[0].lbnd, ubnd = h.dims[0].ubnd, inc = h.dims[0].inc; i <= ubnd; i += inc) { if (i > 0) - scm_putc (' ', port); + scm_putc_unlocked (' ', port); scm_write (scm_array_handle_ref (&h, i), port); } - scm_putc (')', port); + scm_putc_unlocked (')', port); return 1; } diff --git a/libguile/continuations.c b/libguile/continuations.c index 7a842de5c..86627703c 100644 --- a/libguile/continuations.c +++ b/libguile/continuations.c @@ -174,11 +174,11 @@ continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED) { scm_t_contregs *continuation = SCM_CONTREGS (obj); - scm_puts ("#<continuation ", port); + scm_puts_unlocked ("#<continuation ", port); scm_intprint (continuation->num_stack_items, 10, port); - scm_puts (" @ ", port); + scm_puts_unlocked (" @ ", port); scm_uintprint (SCM_SMOB_DATA_1 (obj), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } @@ -498,7 +498,7 @@ print_exception_and_backtrace (SCM port, SCM tag, SCM args) if (should_print_backtrace (tag, stack)) { - scm_puts ("Backtrace:\n", port); + scm_puts_unlocked ("Backtrace:\n", port); scm_display_backtrace_with_highlights (stack, port, SCM_BOOL_F, SCM_BOOL_F, SCM_EOL); diff --git a/libguile/control.c b/libguile/control.c index 661de8f4f..6302c0750 100644 --- a/libguile/control.c +++ b/libguile/control.c @@ -269,9 +269,9 @@ SCM_DEFINE (scm_at_abort, "@abort", 2, 0, 0, (SCM tag, SCM args), void scm_i_prompt_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts ("#<prompt ", port); + scm_puts_unlocked ("#<prompt ", port); scm_intprint (SCM_UNPACK (exp), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } void diff --git a/libguile/deprecation.c b/libguile/deprecation.c index be5fffc90..1622406a8 100644 --- a/libguile/deprecation.c +++ b/libguile/deprecation.c @@ -89,7 +89,7 @@ scm_c_issue_deprecation_warning (const char *msg) fprintf (stderr, "%s\n", msg); else { - scm_puts (msg, scm_current_error_port ()); + scm_puts_unlocked (msg, scm_current_error_port ()); scm_newline (scm_current_error_port ()); } } diff --git a/libguile/dynl.c b/libguile/dynl.c index a2ae6e267..72305a41b 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -185,11 +185,11 @@ scm_t_bits scm_tc16_dynamic_obj; static int dynl_obj_print (SCM exp, SCM port, scm_print_state *pstate) { - scm_puts ("#<dynamic-object ", port); + scm_puts_unlocked ("#<dynamic-object ", port); scm_iprin1 (DYNL_FILENAME (exp), port, pstate); if (DYNL_HANDLE (exp) == NULL) - scm_puts (" (unlinked)", port); - scm_putc ('>', port); + scm_puts_unlocked (" (unlinked)", port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/eval.c b/libguile/eval.c index f73710afc..ad0a84a58 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -913,16 +913,16 @@ static int boot_closure_print (SCM closure, SCM port, scm_print_state *pstate) { SCM args; - scm_puts ("#<boot-closure ", port); + scm_puts_unlocked ("#<boot-closure ", port); scm_uintprint (SCM_UNPACK (closure), 16, port); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); args = scm_make_list (scm_from_int (BOOT_CLOSURE_NUM_REQUIRED_ARGS (closure)), scm_from_latin1_symbol ("_")); if (!BOOT_CLOSURE_IS_FIXED (closure) && BOOT_CLOSURE_HAS_REST_ARGS (closure)) args = scm_cons_star (scm_from_latin1_symbol ("_"), args); /* FIXME: optionals and rests */ scm_display (args, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/filesys.c b/libguile/filesys.c index c94bd4188..3856b4412 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -1797,12 +1797,12 @@ SCM_DEFINE (scm_closedir, "closedir", 1, 0, 0, static int scm_dir_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts ("#<", port); + scm_puts_unlocked ("#<", port); if (!SCM_DIR_OPEN_P (exp)) - scm_puts ("closed: ", port); - scm_puts ("directory stream ", port); + scm_puts_unlocked ("closed: ", port); + scm_puts_unlocked ("directory stream ", port); scm_uintprint (SCM_SMOB_DATA_1 (exp), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/fluids.c b/libguile/fluids.c index 661f06ca7..944615606 100644 --- a/libguile/fluids.c +++ b/libguile/fluids.c @@ -79,25 +79,25 @@ grow_dynamic_state (SCM state) void scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts ("#<fluid ", port); + scm_puts_unlocked ("#<fluid ", port); scm_intprint ((int) FLUID_NUM (exp), 10, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } void scm_i_dynamic_state_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts ("#<dynamic-state ", port); + scm_puts_unlocked ("#<dynamic-state ", port); scm_intprint (SCM_UNPACK (exp), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } void scm_i_with_fluids_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts ("#<with-fluids ", port); + scm_puts_unlocked ("#<with-fluids ", port); scm_intprint (SCM_UNPACK (exp), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } diff --git a/libguile/foreign.c b/libguile/foreign.c index e431c5010..973bfc3bd 100644 --- a/libguile/foreign.c +++ b/libguile/foreign.c @@ -330,9 +330,9 @@ SCM_DEFINE (scm_set_pointer_finalizer_x, "set-pointer-finalizer!", 2, 0, 0, void scm_i_pointer_print (SCM pointer, SCM port, scm_print_state *pstate) { - scm_puts ("#<pointer 0x", port); + scm_puts_unlocked ("#<pointer 0x", port); scm_uintprint (scm_to_uintptr (scm_pointer_address (pointer)), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } diff --git a/libguile/fports.c b/libguile/fports.c index 41897ac20..683c25bde 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -636,7 +636,7 @@ fport_input_waiting (SCM port) static int fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts ("#<", port); + scm_puts_unlocked ("#<", port); scm_print_port_mode (exp, port); if (SCM_OPFPORTP (exp)) { @@ -645,8 +645,8 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) if (scm_is_string (name) || scm_is_symbol (name)) scm_display (name, port); else - scm_puts (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port); - scm_putc (' ', port); + scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port); + scm_putc_unlocked (' ', port); fdes = (SCM_FSTREAM (exp))->fdes; #if (defined HAVE_TTYNAME) && (defined HAVE_POSIX) @@ -658,11 +658,11 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) } else { - scm_puts (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port); - scm_putc (' ', port); + scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port); + scm_putc_unlocked (' ', port); scm_uintprint ((scm_t_bits) SCM_PTAB_ENTRY (exp), 16, port); } - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/frames.c b/libguile/frames.c index 2e83cde9a..b805137a4 100644 --- a/libguile/frames.c +++ b/libguile/frames.c @@ -45,12 +45,12 @@ scm_c_make_frame (SCM stack_holder, SCM *fp, SCM *sp, void scm_i_frame_print (SCM frame, SCM port, scm_print_state *pstate) { - scm_puts ("#<frame ", port); + scm_puts_unlocked ("#<frame ", port); scm_uintprint (SCM_UNPACK (frame), 16, port); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); scm_write (scm_frame_procedure (frame), port); /* don't write args, they can get us into trouble. */ - scm_puts (">", port); + scm_puts_unlocked (">", port); } diff --git a/libguile/gdbint.c b/libguile/gdbint.c index ae6ab63a2..b502c7c46 100644 --- a/libguile/gdbint.c +++ b/libguile/gdbint.c @@ -150,7 +150,7 @@ gdb_read (char *str) SCM_BEGIN_FOREIGN_BLOCK; unmark_port (gdb_input_port); scm_seek (gdb_input_port, SCM_INUM0, scm_from_int (SEEK_SET)); - scm_puts (str, gdb_input_port); + scm_puts_unlocked (str, gdb_input_port); scm_truncate_file (gdb_input_port, SCM_UNDEFINED); scm_seek (gdb_input_port, SCM_INUM0, scm_from_int (SEEK_SET)); diff --git a/libguile/gsubr.c b/libguile/gsubr.c index ca92cc5f7..84846cf35 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -858,13 +858,13 @@ scm_c_define_gsubr_with_generic (const char *name, SCM gsubr_21l(SCM req1, SCM req2, SCM opt, SCM rst) { - scm_puts ("gsubr-2-1-l:\n req1: ", scm_cur_outp); + scm_puts_unlocked ("gsubr-2-1-l:\n req1: ", scm_cur_outp); scm_display(req1, scm_cur_outp); - scm_puts ("\n req2: ", scm_cur_outp); + scm_puts_unlocked ("\n req2: ", scm_cur_outp); scm_display(req2, scm_cur_outp); - scm_puts ("\n opt: ", scm_cur_outp); + scm_puts_unlocked ("\n opt: ", scm_cur_outp); scm_display(opt, scm_cur_outp); - scm_puts ("\n rest: ", scm_cur_outp); + scm_puts_unlocked ("\n rest: ", scm_cur_outp); scm_display(rst, scm_cur_outp); scm_newline(scm_cur_outp); return SCM_UNSPECIFIED; diff --git a/libguile/guardians.c b/libguile/guardians.c index dfc533233..532137857 100644 --- a/libguile/guardians.c +++ b/libguile/guardians.c @@ -86,16 +86,16 @@ guardian_print (SCM guardian, SCM port, scm_print_state *pstate SCM_UNUSED) { t_guardian *g = GUARDIAN_DATA (guardian); - scm_puts ("#<guardian ", port); + scm_puts_unlocked ("#<guardian ", port); scm_uintprint ((scm_t_bits) g, 16, port); - scm_puts (" (reachable: ", port); + scm_puts_unlocked (" (reachable: ", port); scm_display (scm_from_uint (g->live), port); - scm_puts (" unreachable: ", port); + scm_puts_unlocked (" unreachable: ", port); scm_display (scm_length (g->zombies), port); - scm_puts (")", port); + scm_puts_unlocked (")", port); - scm_puts (">", port); + scm_puts_unlocked (">", port); return 1; } diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 55f088149..4091afeb9 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -167,12 +167,12 @@ scm_i_rehash (SCM table, void scm_i_hashtable_print (SCM exp, SCM port, scm_print_state *pstate) { - scm_puts ("#<hash-table ", port); + scm_puts_unlocked ("#<hash-table ", port); scm_uintprint (SCM_HASHTABLE_N_ITEMS (exp), 10, port); - scm_putc ('/', port); + scm_putc_unlocked ('/', port); scm_uintprint (SCM_SIMPLE_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)), 10, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); } diff --git a/libguile/hooks.c b/libguile/hooks.c index 14335f879..782636e4e 100644 --- a/libguile/hooks.c +++ b/libguile/hooks.c @@ -134,22 +134,22 @@ static int hook_print (SCM hook, SCM port, scm_print_state *pstate) { SCM ls, name; - scm_puts ("#<hook ", port); + scm_puts_unlocked ("#<hook ", port); scm_intprint (SCM_HOOK_ARITY (hook), 10, port); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); scm_uintprint (SCM_UNPACK (hook), 16, port); ls = SCM_HOOK_PROCEDURES (hook); while (scm_is_pair (ls)) { - scm_putc (' ', port); + scm_putc_unlocked (' ', port); name = scm_procedure_name (SCM_CAR (ls)); if (scm_is_true (name)) scm_iprin1 (name, port, pstate); else - scm_putc ('?', port); + scm_putc_unlocked ('?', port); ls = SCM_CDR (ls); } - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/keywords.c b/libguile/keywords.c index 3b9a9228c..e4a79ac4d 100644 --- a/libguile/keywords.c +++ b/libguile/keywords.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2008, 2009, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -47,7 +47,7 @@ scm_t_bits scm_tc16_keyword; static int keyword_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts ("#:", port); + scm_puts_unlocked ("#:", port); scm_display (KEYWORDSYM (exp), port); return 1; } diff --git a/libguile/load.c b/libguile/load.c index e5126ed68..d6c318b98 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -663,11 +663,11 @@ compiled_is_fresh (SCM full_filename, SCM compiled_filename, else { compiled_is_newer = 0; - scm_puts (";;; note: source file ", scm_current_error_port ()); + scm_puts_unlocked (";;; note: source file ", scm_current_error_port ()); scm_display (full_filename, scm_current_error_port ()); - scm_puts ("\n;;; newer than compiled ", scm_current_error_port ()); + scm_puts_unlocked ("\n;;; newer than compiled ", scm_current_error_port ()); scm_display (compiled_filename, scm_current_error_port ()); - scm_puts ("\n", scm_current_error_port ()); + scm_puts_unlocked ("\n", scm_current_error_port ()); } return compiled_is_newer; @@ -685,7 +685,7 @@ do_try_auto_compile (void *data) SCM source = SCM_PACK_POINTER (data); SCM comp_mod, compile_file; - scm_puts (";;; compiling ", scm_current_error_port ()); + scm_puts_unlocked (";;; compiling ", scm_current_error_port ()); scm_display (source, scm_current_error_port ()); scm_newline (scm_current_error_port ()); @@ -714,16 +714,16 @@ do_try_auto_compile (void *data) /* Assume `*current-warning-prefix*' has an appropriate value. */ res = scm_call_n (scm_variable_ref (compile_file), args, 5); - scm_puts (";;; compiled ", scm_current_error_port ()); + scm_puts_unlocked (";;; compiled ", scm_current_error_port ()); scm_display (res, scm_current_error_port ()); scm_newline (scm_current_error_port ()); return res; } else { - scm_puts (";;; it seems ", scm_current_error_port ()); + scm_puts_unlocked (";;; it seems ", scm_current_error_port ()); scm_display (source, scm_current_error_port ()); - scm_puts ("\n;;; is part of the compiler; skipping auto-compilation\n", + scm_puts_unlocked ("\n;;; is part of the compiler; skipping auto-compilation\n", scm_current_error_port ()); return SCM_BOOL_F; } @@ -738,16 +738,16 @@ auto_compile_catch_handler (void *data, SCM tag, SCM throw_args) oport = scm_open_output_string (); scm_print_exception (oport, SCM_BOOL_F, tag, throw_args); - scm_puts (";;; WARNING: compilation of ", scm_current_error_port ()); + scm_puts_unlocked (";;; WARNING: compilation of ", scm_current_error_port ()); scm_display (source, scm_current_error_port ()); - scm_puts (" failed:\n", scm_current_error_port ()); + scm_puts_unlocked (" failed:\n", scm_current_error_port ()); lines = scm_string_split (scm_get_output_string (oport), SCM_MAKE_CHAR ('\n')); for (; scm_is_pair (lines); lines = scm_cdr (lines)) if (scm_c_string_length (scm_car (lines))) { - scm_puts (";;; ", scm_current_error_port ()); + scm_puts_unlocked (";;; ", scm_current_error_port ()); scm_display (scm_car (lines), scm_current_error_port ()); scm_newline (scm_current_error_port ()); } @@ -765,7 +765,7 @@ SCM_DEFINE (scm_sys_warn_auto_compilation_enabled, "%warn-auto-compilation-enabl if (!message_shown) { - scm_puts (";;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0\n" + scm_puts_unlocked (";;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0\n" ";;; or pass the --no-auto-compile argument to disable.\n", scm_current_error_port ()); message_shown = 1; @@ -933,7 +933,7 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 0, 0, 1, if (stat_ret == 0 && compiled_is_fresh (full_filename, fallback, &stat_source, &stat_compiled)) { - scm_puts (";;; found fresh local cache at ", scm_current_error_port ()); + scm_puts_unlocked (";;; found fresh local cache at ", scm_current_error_port ()); scm_display (fallback, scm_current_error_port ()); scm_newline (scm_current_error_port ()); return scm_load_compiled_with_vm (fallback); diff --git a/libguile/macros.c b/libguile/macros.c index 5a4b9d6ca..7423e9758 100644 --- a/libguile/macros.c +++ b/libguile/macros.c @@ -49,11 +49,11 @@ static int macro_print (SCM macro, SCM port, scm_print_state *pstate) { if (scm_is_false (SCM_MACRO_TYPE (macro))) - scm_puts ("#<primitive-syntax-transformer ", port); + scm_puts_unlocked ("#<primitive-syntax-transformer ", port); else - scm_puts ("#<syntax-transformer ", port); + scm_puts_unlocked ("#<syntax-transformer ", port); scm_iprin1 (scm_macro_name (macro), port, pstate); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/mallocs.c b/libguile/mallocs.c index 6a366aeea..bd8aee8ea 100644 --- a/libguile/mallocs.c +++ b/libguile/mallocs.c @@ -1,5 +1,5 @@ /* classes: src_files - * Copyright (C) 1995,1997,1998,2000,2001, 2006 Free Software Foundation, Inc. + * Copyright (C) 1995,1997,1998,2000,2001, 2006, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -46,9 +46,9 @@ scm_t_bits scm_tc16_malloc; static int malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { - scm_puts("#<malloc ", port); + scm_puts_unlocked("#<malloc ", port); scm_uintprint (SCM_SMOB_DATA (exp), 16, port); - scm_putc('>', port); + scm_putc_unlocked('>', port); return 1; } diff --git a/libguile/memoize.c b/libguile/memoize.c index e5ed62960..9a2caad38 100644 --- a/libguile/memoize.c +++ b/libguile/memoize.c @@ -148,9 +148,9 @@ static const char *const memoized_tags[] = static int scm_print_memoized (SCM memoized, SCM port, scm_print_state *pstate) { - scm_puts ("#<memoized ", port); + scm_puts_unlocked ("#<memoized ", port); scm_write (scm_unmemoize_expression (memoized), port); - scm_puts (">", port); + scm_puts_unlocked (">", port); return 1; } diff --git a/libguile/objcodes.c b/libguile/objcodes.c index f026783df..77765d948 100644 --- a/libguile/objcodes.c +++ b/libguile/objcodes.c @@ -366,9 +366,9 @@ SCM_DEFINE (scm_write_objcode, "write-objcode", 2, 0, 0, void scm_i_objcode_print (SCM objcode, SCM port, scm_print_state *pstate) { - scm_puts ("#<objcode ", port); + scm_puts_unlocked ("#<objcode ", port); scm_uintprint ((scm_t_bits)SCM_OBJCODE_BASE (objcode), 16, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); } diff --git a/libguile/ports.c b/libguile/ports.c index eb47fbc34..394d4c137 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -2148,6 +2148,22 @@ scm_flush (SCM port) /* Output. */ +void +scm_putc (char c, SCM port) +{ + scm_c_lock_port (port); + scm_putc_unlocked (c, port); + scm_c_unlock_port (port); +} + +void +scm_puts (const char *s, SCM port) +{ + scm_c_lock_port (port); + scm_puts_unlocked (s, port); + scm_c_unlock_port (port); +} + /* scm_c_write * * Used by an application to write arbitrary number of bytes to an SCM @@ -2527,7 +2543,7 @@ SCM_DEFINE (scm_set_port_filename_x, "set-port-filename!", 2, 0, 0, void scm_print_port_mode (SCM exp, SCM port) { - scm_puts (SCM_CLOSEDP (exp) + scm_puts_unlocked (SCM_CLOSEDP (exp) ? "closed: " : (SCM_RDNG & SCM_CELL_WORD_0 (exp) ? (SCM_WRTNG & SCM_CELL_WORD_0 (exp) @@ -2545,12 +2561,12 @@ scm_port_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) char *type = SCM_PTOBNAME (SCM_PTOBNUM (exp)); if (!type) type = "port"; - scm_puts ("#<", port); + scm_puts_unlocked ("#<", port); scm_print_port_mode (exp, port); - scm_puts (type, port); - scm_putc (' ', port); + scm_puts_unlocked (type, port); + scm_putc_unlocked (' ', port); scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/ports.h b/libguile/ports.h index 2877ef60f..6ff259f5d 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -339,8 +339,10 @@ 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); -SCM_INLINE void scm_puts (const char *str_data, SCM port); +SCM_API void scm_putc (char c, SCM port); +SCM_INLINE void scm_putc_unlocked (char c, SCM port); +SCM_API void scm_puts (const char *str_data, SCM port); +SCM_INLINE void scm_puts_unlocked (const char *str_data, SCM port); SCM_API void scm_c_write (SCM port, const void *buffer, size_t size); SCM_API void scm_lfwrite (const char *ptr, size_t size, SCM port); SCM_INTERNAL void scm_lfwrite_substr (SCM str, size_t start, size_t end, @@ -457,14 +459,14 @@ scm_peek_byte_or_eof_unlocked (SCM port) } SCM_INLINE_IMPLEMENTATION void -scm_putc (char c, SCM port) +scm_putc_unlocked (char c, SCM port) { SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port"); scm_lfwrite (&c, 1, port); } SCM_INLINE_IMPLEMENTATION void -scm_puts (const char *s, SCM port) +scm_puts_unlocked (const char *s, SCM port) { SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port"); scm_lfwrite (s, strlen (s), port); diff --git a/libguile/print.c b/libguile/print.c index 5ee48ee66..bc76c63cd 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -156,7 +156,7 @@ do \ { \ if (pstate->top - pstate->list_offset >= pstate->level) \ { \ - scm_putc ('#', port); \ + scm_putc_unlocked ('#', port); \ return; \ } \ } \ @@ -300,9 +300,9 @@ print_circref (SCM port, scm_print_state *pstate, SCM ref) for (i = pstate->top - 1; 1; --i) if (scm_is_eq (PSTATE_STACK_REF(pstate, i), ref)) break; - scm_putc ('#', port); + scm_putc_unlocked ('#', port); scm_intprint (i - self, 10, port); - scm_putc ('#', port); + scm_putc_unlocked ('#', port); } /* Print the name of a symbol. */ @@ -452,7 +452,7 @@ static void iprin1 (SCM exp, SCM port, scm_print_state *pstate); scm_intprint (i, 8, port); \ else \ { \ - scm_puts ("x", port); \ + scm_puts_unlocked ("x", port); \ scm_intprint (i, 16, port); \ } \ } \ @@ -507,7 +507,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) else if (SCM_IFLAGP (exp) && ((size_t) SCM_IFLAGNUM (exp) < (sizeof iflagnames / sizeof (char *)))) { - scm_puts (iflagnames [SCM_IFLAGNUM (exp)], port); + scm_puts_unlocked (iflagnames [SCM_IFLAGNUM (exp)], port); } else { @@ -601,11 +601,11 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) } else { - scm_puts ("#<uninterned-symbol ", port); + scm_puts_unlocked ("#<uninterned-symbol ", port); scm_i_print_symbol_name (exp, port); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); scm_uintprint (SCM_UNPACK (exp), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } break; case scm_tc7_variable: @@ -652,7 +652,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) break; case scm_tc7_wvect: ENTER_NESTED_DATA (pstate, exp, circref); - scm_puts ("#w(", port); + scm_puts_unlocked ("#w(", port); goto common_vector_printer; case scm_tc7_bytevector: @@ -660,7 +660,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) break; case scm_tc7_vector: ENTER_NESTED_DATA (pstate, exp, circref); - scm_puts ("#(", port); + scm_puts_unlocked ("#(", port); common_vector_printer: { register long i; @@ -675,7 +675,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) for (i = 0; i < last; ++i) { scm_iprin1 (scm_c_vector_ref (exp, i), port, pstate); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); } if (i == last) { @@ -683,8 +683,8 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) scm_iprin1 (scm_c_vector_ref (exp, i), port, pstate); } if (cutp) - scm_puts (" ...", port); - scm_putc (')', port); + scm_puts_unlocked (" ...", port); + scm_putc_unlocked (')', port); } EXIT_NESTED_DATA (pstate); break; @@ -1077,7 +1077,7 @@ write_character_escaped (scm_t_wchar ch, int string_escapes_p, SCM port) name = scm_i_charname (SCM_MAKE_CHAR (ch)); if (name != NULL) - scm_puts (name, port); + scm_puts_unlocked (name, port); else PRINT_CHAR_ESCAPE (ch, port); } @@ -1158,19 +1158,19 @@ scm_uintprint (scm_t_uintmax n, int radix, SCM port) void scm_ipruk (char *hdr, SCM ptr, SCM port) { - scm_puts ("#<unknown-", port); - scm_puts (hdr, port); + scm_puts_unlocked ("#<unknown-", port); + scm_puts_unlocked (hdr, port); if (1) /* (scm_in_heap_p (ptr)) */ /* FIXME */ { - scm_puts (" (0x", port); + scm_puts_unlocked (" (0x", port); scm_uintprint (SCM_CELL_WORD_0 (ptr), 16, port); - scm_puts (" . 0x", port); + scm_puts_unlocked (" . 0x", port); scm_uintprint (SCM_CELL_WORD_1 (ptr), 16, port); - scm_puts (") @", port); + scm_puts_unlocked (") @", port); } - scm_puts (" 0x", port); + scm_puts_unlocked (" 0x", port); scm_uintprint (SCM_UNPACK (ptr), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } @@ -1181,7 +1181,7 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, scm_print_state *pstate) { register SCM hare, tortoise; long floor = pstate->top - 2; - scm_puts (hdr, port); + scm_puts_unlocked (hdr, port); /* CHECK_INTS; */ if (pstate->fancyp) goto fancy_printing; @@ -1211,18 +1211,18 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, scm_print_state *pstate) if (scm_is_eq (PSTATE_STACK_REF(pstate, i), exp)) goto circref; PUSH_REF (pstate, exp); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); /* CHECK_INTS; */ scm_iprin1 (SCM_CAR (exp), port, pstate); } if (!SCM_NULL_OR_NIL_P (exp)) { - scm_puts (" . ", port); + scm_puts_unlocked (" . ", port); scm_iprin1 (exp, port, pstate); } end: - scm_putc (tlr, port); + scm_putc_unlocked (tlr, port); pstate->top = floor + 2; return; @@ -1243,7 +1243,7 @@ fancy_printing: { if (n == 0) { - scm_puts (" ...", port); + scm_puts_unlocked (" ...", port); goto skip_tail; } else @@ -1251,14 +1251,14 @@ fancy_printing: } PUSH_REF(pstate, exp); ++pstate->list_offset; - scm_putc (' ', port); + scm_putc_unlocked (' ', port); /* CHECK_INTS; */ scm_iprin1 (SCM_CAR (exp), port, pstate); } } if (!SCM_NULL_OR_NIL_P (exp)) { - scm_puts (" . ", port); + scm_puts_unlocked (" . ", port); scm_iprin1 (exp, port, pstate); } skip_tail: @@ -1269,7 +1269,7 @@ fancy_circref: pstate->list_offset -= pstate->top - floor - 2; circref: - scm_puts (" . ", port); + scm_puts_unlocked (" . ", port); print_circref (port, pstate, exp); goto end; } @@ -1422,7 +1422,7 @@ SCM_DEFINE (scm_newline, "newline", 0, 1, 0, SCM_VALIDATE_OPORT_VALUE (1, port); - scm_putc ('\n', SCM_COERCE_OUTPORT (port)); + scm_putc_unlocked ('\n', SCM_COERCE_OUTPORT (port)); return SCM_UNSPECIFIED; } #undef FUNC_NAME diff --git a/libguile/programs.c b/libguile/programs.c index b84f84bd3..128e0312a 100644 --- a/libguile/programs.c +++ b/libguile/programs.c @@ -82,22 +82,22 @@ scm_i_program_print (SCM program, SCM port, scm_print_state *pstate) if (SCM_PROGRAM_IS_CONTINUATION (program)) { /* twingliness */ - scm_puts ("#<continuation ", port); + scm_puts_unlocked ("#<continuation ", port); scm_uintprint (SCM_UNPACK (program), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } else if (SCM_PROGRAM_IS_PARTIAL_CONTINUATION (program)) { /* twingliness */ - scm_puts ("#<partial-continuation ", port); + scm_puts_unlocked ("#<partial-continuation ", port); scm_uintprint (SCM_UNPACK (program), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } else if (scm_is_false (write_program) || print_error) { - scm_puts ("#<program ", port); + scm_puts_unlocked ("#<program ", port); scm_uintprint (SCM_UNPACK (program), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } else { diff --git a/libguile/promises.c b/libguile/promises.c index 4aff15092..57a208104 100644 --- a/libguile/promises.c +++ b/libguile/promises.c @@ -88,11 +88,11 @@ static int promise_print (SCM exp, SCM port, scm_print_state *pstate) { int writingp = SCM_WRITINGP (pstate); - scm_puts ("#<promise ", port); + scm_puts_unlocked ("#<promise ", port); SCM_SET_WRITINGP (pstate, 1); scm_iprin1 (SCM_PROMISE_DATA (exp), port, pstate); SCM_SET_WRITINGP (pstate, writingp); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return !0; } diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c index 62a7227de..c77dbc0ce 100644 --- a/libguile/r6rs-ports.c +++ b/libguile/r6rs-ports.c @@ -688,7 +688,7 @@ SCM_DEFINE (scm_put_u8, "put-u8", 2, 0, 0, SCM_VALIDATE_BINARY_OUTPUT_PORT (1, port); c_octet = scm_to_uint8 (octet); - scm_putc ((char) c_octet, port); + scm_putc_unlocked ((char) c_octet, port); return SCM_UNSPECIFIED; } diff --git a/libguile/smob.c b/libguile/smob.c index 02ad1a511..cb6f803a2 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -108,14 +108,14 @@ int scm_smob_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) { long n = SCM_SMOBNUM (exp); - scm_puts ("#<", port); - scm_puts (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port); - scm_putc (' ', port); + scm_puts_unlocked ("#<", port); + scm_puts_unlocked (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port); + scm_putc_unlocked (' ', port); if (scm_smobs[n].size) scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port); else scm_uintprint (SCM_UNPACK (exp), 16, port); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/srcprop.c b/libguile/srcprop.c index 9f0749861..f63f1bc61 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -95,11 +95,11 @@ static int srcprops_print (SCM obj, SCM port, scm_print_state *pstate) { int writingp = SCM_WRITINGP (pstate); - scm_puts ("#<srcprops ", port); + scm_puts_unlocked ("#<srcprops ", port); SCM_SET_WRITINGP (pstate, 1); scm_iprin1 (scm_srcprops_to_alist (obj), port, pstate); SCM_SET_WRITINGP (pstate, writingp); - scm_putc ('>', port); + scm_putc_unlocked ('>', port); return 1; } diff --git a/libguile/srfi-14.c b/libguile/srfi-14.c index e2f66681a..09323704d 100644 --- a/libguile/srfi-14.c +++ b/libguile/srfi-14.c @@ -597,27 +597,27 @@ charset_print (SCM charset, SCM port, scm_print_state *pstate SCM_UNUSED) p = SCM_CHARSET_DATA (charset); - scm_puts ("#<charset {", port); + scm_puts_unlocked ("#<charset {", port); for (i = 0; i < p->len; i++) { if (first) first = 0; else - scm_puts (" ", port); + scm_puts_unlocked (" ", port); scm_write (SCM_MAKE_CHAR (p->ranges[i].lo), port); if (p->ranges[i].lo != p->ranges[i].hi) { - scm_puts ("..", port); + scm_puts_unlocked ("..", port); scm_write (SCM_MAKE_CHAR (p->ranges[i].hi), port); } if (i >= max_ranges_to_print) { /* Too many to print here. Quit early. */ - scm_puts (" ...", port); + scm_puts_unlocked (" ...", port); break; } } - scm_puts ("}>", port); + scm_puts_unlocked ("}>", port); return 1; } @@ -630,16 +630,16 @@ charset_cursor_print (SCM cursor, SCM port, cur = (scm_t_char_set_cursor *) SCM_SMOB_DATA (cursor); - scm_puts ("#<charset-cursor ", port); + scm_puts_unlocked ("#<charset-cursor ", port); if (cur->range == (size_t) (-1)) - scm_puts ("(empty)", port); + scm_puts_unlocked ("(empty)", port); else { scm_write (scm_from_size_t (cur->range), port); - scm_puts (":", port); + scm_puts_unlocked (":", port); scm_write (scm_from_int32 (cur->n), port); } - scm_puts (">", port); + scm_puts_unlocked (">", port); return 1; } diff --git a/libguile/stackchk.c b/libguile/stackchk.c index 7b9b4c428..208ba97ed 100644 --- a/libguile/stackchk.c +++ b/libguile/stackchk.c @@ -86,11 +86,11 @@ scm_stack_report () scm_uintprint ((scm_stack_size (thread->continuation_base) * sizeof (SCM_STACKITEM)), 16, port); - scm_puts (" of stack: 0x", port); + scm_puts_unlocked (" of stack: 0x", port); scm_uintprint ((scm_t_bits) thread->continuation_base, 16, port); - scm_puts (" - 0x", port); + scm_puts_unlocked (" - 0x", port); scm_uintprint ((scm_t_bits) &stack, 16, port); - scm_puts ("\n", port); + scm_puts_unlocked ("\n", port); } diff --git a/libguile/struct.c b/libguile/struct.c index cb046a1a2..8b21330b0 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -981,22 +981,22 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate) { SCM vtable = SCM_STRUCT_VTABLE (exp); SCM name = scm_struct_vtable_name (vtable); - scm_puts ("#<", port); + scm_puts_unlocked ("#<", port); if (scm_is_true (name)) { scm_display (name, port); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); } else { if (SCM_VTABLE_FLAG_IS_SET (vtable, SCM_VTABLE_FLAG_VTABLE)) - scm_puts ("vtable:", port); + scm_puts_unlocked ("vtable:", port); else - scm_puts ("struct:", port); + scm_puts_unlocked ("struct:", port); scm_uintprint (SCM_UNPACK (vtable), 16, port); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); scm_write (SCM_VTABLE_LAYOUT (vtable), port); - scm_putc (' ', port); + scm_putc_unlocked (' ', port); } scm_uintprint (SCM_UNPACK (exp), 16, port); /* hackety hack */ @@ -1004,19 +1004,19 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate) { if (scm_is_true (SCM_STRUCT_PROCEDURE (exp))) { - scm_puts (" proc: ", port); + scm_puts_unlocked (" proc: ", port); if (scm_is_true (scm_procedure_p (SCM_STRUCT_PROCEDURE (exp)))) scm_write (SCM_STRUCT_PROCEDURE (exp), port); else - scm_puts ("(not a procedure?)", port); + scm_puts_unlocked ("(not a procedure?)", port); } if (SCM_STRUCT_SETTER_P (exp)) { - scm_puts (" setter: ", port); + scm_puts_unlocked (" setter: ", port); scm_write (SCM_STRUCT_SETTER (exp), port); } } - scm_putc ('>', port); + scm_putc_unlocked ('>', port); } } diff --git a/libguile/threads.c b/libguile/threads.c index 2560b69a2..ec5001ff4 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -367,11 +367,11 @@ thread_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) else id = u.um; - scm_puts ("#<thread ", port); + scm_puts_unlocked ("#<thread ", port); scm_uintprint (id, 10, port); - scm_puts (" (", port); + scm_puts_unlocked (" (", port); scm_uintprint ((scm_t_bits)t, 16, port); - scm_puts (")>", port); + scm_puts_unlocked (")>", port); return 1; } @@ -1270,9 +1270,9 @@ static int fat_mutex_print (SCM mx, SCM port, scm_print_state *pstate SCM_UNUSED) { fat_mutex *m = SCM_MUTEX_DATA (mx); - scm_puts ("#<mutex ", port); + scm_puts_unlocked ("#<mutex ", port); scm_uintprint ((scm_t_bits)m, 16, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); return 1; } @@ -1727,9 +1727,9 @@ static int fat_cond_print (SCM cv, SCM port, scm_print_state *pstate SCM_UNUSED) { fat_cond *c = SCM_CONDVAR_DATA (cv); - scm_puts ("#<condition-variable ", port); + scm_puts_unlocked ("#<condition-variable ", port); scm_uintprint ((scm_t_bits)c, 16, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); return 1; } diff --git a/libguile/throw.c b/libguile/throw.c index e3b5afa97..29ccc8aba 100644 --- a/libguile/throw.c +++ b/libguile/throw.c @@ -370,7 +370,7 @@ handler_message (void *handler_data, SCM tag, SCM args) if (should_print_backtrace (tag, stack)) { - scm_puts ("Backtrace:\n", p); + scm_puts_unlocked ("Backtrace:\n", p); scm_display_backtrace_with_highlights (stack, p, SCM_BOOL_F, SCM_BOOL_F, SCM_EOL); diff --git a/libguile/values.c b/libguile/values.c index ab7773141..005be5063 100644 --- a/libguile/values.c +++ b/libguile/values.c @@ -60,9 +60,9 @@ print_values (SCM obj, SCM pwps) SCM port = SCM_PORT_WITH_PS_PORT (pwps); scm_print_state *ps = SCM_PRINT_STATE (SCM_PORT_WITH_PS_PS (pwps)); - scm_puts ("#<values ", port); + scm_puts_unlocked ("#<values ", port); scm_iprin1 (values, port, ps); - scm_puts (">", port); + scm_puts_unlocked (">", port); return SCM_UNSPECIFIED; } diff --git a/libguile/variable.c b/libguile/variable.c index a9cc60e20..7b3f3356c 100644 --- a/libguile/variable.c +++ b/libguile/variable.c @@ -36,11 +36,11 @@ void scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate) { - scm_puts ("#<variable ", port); + scm_puts_unlocked ("#<variable ", port); scm_uintprint (SCM_UNPACK (exp), 16, port); - scm_puts (" value: ", port); + scm_puts_unlocked (" value: ", port); scm_iprin1 (SCM_VARIABLE_REF (exp), port, pstate); - scm_putc('>', port); + scm_putc_unlocked('>', port); } diff --git a/libguile/vm.c b/libguile/vm.c index 9958e11d7..9b8e93a12 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -83,9 +83,9 @@ static SCM sym_debug; void scm_i_vm_cont_print (SCM x, SCM port, scm_print_state *pstate) { - scm_puts ("#<vm-continuation ", port); + scm_puts_unlocked ("#<vm-continuation ", port); scm_uintprint (SCM_UNPACK (x), 16, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); } /* In theory, a number of vm instances can be active in the call trace, and we @@ -351,22 +351,22 @@ scm_i_vm_print (SCM x, SCM port, scm_print_state *pstate) vm = SCM_VM_DATA (x); - scm_puts ("#<vm ", port); + scm_puts_unlocked ("#<vm ", port); switch (vm->engine) { case SCM_VM_REGULAR_ENGINE: - scm_puts ("regular-engine ", port); + scm_puts_unlocked ("regular-engine ", port); break; case SCM_VM_DEBUG_ENGINE: - scm_puts ("debug-engine ", port); + scm_puts_unlocked ("debug-engine ", port); break; default: - scm_puts ("unknown-engine ", port); + scm_puts_unlocked ("unknown-engine ", port); } scm_uintprint (SCM_UNPACK (x), 16, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); } static SCM diff --git a/libguile/weak-set.c b/libguile/weak-set.c index 626b29086..53d22a3da 100644 --- a/libguile/weak-set.c +++ b/libguile/weak-set.c @@ -619,12 +619,12 @@ make_weak_set (unsigned long k) void scm_i_weak_set_print (SCM exp, SCM port, scm_print_state *pstate) { - scm_puts ("#<", port); - scm_puts ("weak-set ", port); + scm_puts_unlocked ("#<", port); + scm_puts_unlocked ("weak-set ", port); scm_uintprint (SCM_WEAK_SET (exp)->n_items, 10, port); - scm_putc ('/', port); + scm_putc_unlocked ('/', port); scm_uintprint (SCM_WEAK_SET (exp)->size, 10, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); } static void diff --git a/libguile/weak-table.c b/libguile/weak-table.c index 3ec113ab7..18e164843 100644 --- a/libguile/weak-table.c +++ b/libguile/weak-table.c @@ -719,12 +719,12 @@ make_weak_table (unsigned long k, scm_t_weak_table_kind kind) void scm_i_weak_table_print (SCM exp, SCM port, scm_print_state *pstate) { - scm_puts ("#<", port); - scm_puts ("weak-table ", port); + scm_puts_unlocked ("#<", port); + scm_puts_unlocked ("weak-table ", port); scm_uintprint (SCM_WEAK_TABLE (exp)->n_items, 10, port); - scm_putc ('/', port); + scm_putc_unlocked ('/', port); scm_uintprint (SCM_WEAK_TABLE (exp)->size, 10, port); - scm_puts (">", port); + scm_puts_unlocked (">", port); } static void |