diff options
author | Marius Vollmer <mvo@zagadka.de> | 2005-01-24 19:14:54 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2005-01-24 19:14:54 +0000 |
commit | a54a94b39707f47a1f30533bcf7664094d65d073 (patch) | |
tree | 69a524a4c3fbb084e1e2fef05da61e1852700909 /libguile/print.c | |
parent | be1b896c82273d97b79cd839d7281b46e54920f8 (diff) | |
download | guile-a54a94b39707f47a1f30533bcf7664094d65d073.tar.gz |
Threading changes.
Diffstat (limited to 'libguile/print.c')
-rw-r--r-- | libguile/print.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libguile/print.c b/libguile/print.c index be6b7c235..3c5e9027c 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -133,7 +133,7 @@ do { \ SCM scm_print_state_vtable = SCM_BOOL_F; static SCM print_state_pool = SCM_EOL; -SCM_MUTEX (print_state_mutex); +pthread_mutex_t print_state_mutex = PTHREAD_MUTEX_INITIALIZER; #ifdef GUILE_DEBUG /* Used for debugging purposes */ @@ -173,13 +173,13 @@ scm_make_print_state () SCM answer = SCM_BOOL_F; /* First try to allocate a print state from the pool */ - scm_i_plugin_mutex_lock (&print_state_mutex); + pthread_mutex_lock (&print_state_mutex); if (!scm_is_null (print_state_pool)) { answer = SCM_CAR (print_state_pool); print_state_pool = SCM_CDR (print_state_pool); } - scm_i_plugin_mutex_unlock (&print_state_mutex); + pthread_mutex_unlock (&print_state_mutex); return scm_is_false (answer) ? make_print_state () : answer; } @@ -197,10 +197,10 @@ scm_free_print_state (SCM print_state) pstate->fancyp = 0; pstate->revealed = 0; pstate->highlight_objects = SCM_EOL; - scm_i_plugin_mutex_lock (&print_state_mutex); + pthread_mutex_lock (&print_state_mutex); handle = scm_cons (print_state, print_state_pool); print_state_pool = handle; - scm_i_plugin_mutex_unlock (&print_state_mutex); + pthread_mutex_unlock (&print_state_mutex); } SCM @@ -692,13 +692,13 @@ scm_prin1 (SCM exp, SCM port, int writingp) else { /* First try to allocate a print state from the pool */ - scm_i_plugin_mutex_lock (&print_state_mutex); + pthread_mutex_lock (&print_state_mutex); if (!scm_is_null (print_state_pool)) { handle = print_state_pool; print_state_pool = SCM_CDR (print_state_pool); } - scm_i_plugin_mutex_unlock (&print_state_mutex); + pthread_mutex_unlock (&print_state_mutex); if (scm_is_false (handle)) handle = scm_list_1 (make_print_state ()); pstate_scm = SCM_CAR (handle); @@ -715,10 +715,10 @@ scm_prin1 (SCM exp, SCM port, int writingp) if (scm_is_true (handle) && !pstate->revealed) { - scm_i_plugin_mutex_lock (&print_state_mutex); + pthread_mutex_lock (&print_state_mutex); SCM_SETCDR (handle, print_state_pool); print_state_pool = handle; - scm_i_plugin_mutex_unlock (&print_state_mutex); + pthread_mutex_unlock (&print_state_mutex); } } |