1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-19 18:20:22 +02:00

* null-threads.h, pthread-threads.h

(SCM_I_PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Removed.
(scm_i_pthread_mutexattr_recursive): New.

* threads.c (scm_i_pthread_mutexattr_recursive): Declare.
(scm_i_critical_section_mutex): Do not initialize statically.
(scm_threads_prehistory): Initialize
scm_i_pthread_mutexattr_recursive and scm_i_critical_section_mutex
here.

* eval.c (source_mutex): Do not initialiaze statically.
(scm_init_eval): Do it here, using
scm_i_pthread_mutexattr_recursive.
This commit is contained in:
Marius Vollmer 2005-10-23 20:47:49 +00:00
parent 777f2ed60a
commit d1138028c9
4 changed files with 19 additions and 6 deletions

View file

@ -1481,8 +1481,7 @@ scm_i_thread_sleep_for_gc ()
/* This mutex is used by SCM_CRITICAL_SECTION_START/END.
*/
scm_i_pthread_mutex_t scm_i_critical_section_mutex =
SCM_I_PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
scm_i_pthread_mutex_t scm_i_critical_section_mutex;
int scm_i_critical_section_level = 0;
static SCM framed_critical_section_mutex;
@ -1501,9 +1500,21 @@ scm_frame_critical_section (SCM mutex)
scm_i_pthread_key_t scm_i_freelist, scm_i_freelist2;
scm_i_pthread_mutex_t scm_i_misc_mutex;
#if SCM_USE_PTHREAD_THREADS
pthread_mutexattr_t scm_i_pthread_mutexattr_recursive[1];
#endif
void
scm_threads_prehistory (SCM_STACKITEM *base)
{
#if SCM_USE_PTHREAD_THREADS
pthread_mutexattr_init (scm_i_pthread_mutexattr_recursive);
pthread_mutexattr_settype (scm_i_pthread_mutexattr_recursive,
PTHREAD_MUTEX_RECURSIVE);
#endif
scm_i_pthread_mutex_init (&scm_i_critical_section_mutex,
scm_i_pthread_mutexattr_recursive);
scm_i_pthread_mutex_init (&scm_i_misc_mutex, NULL);
scm_i_pthread_cond_init (&wake_up_cond, NULL);
scm_i_pthread_key_create (&scm_i_freelist, NULL);