1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-15 08:10:17 +02:00

Simplify critical section implementation

* libguile/async.h (SCM_CRITICAL_SECTION_START)
  (SCM_CRITICAL_SECTION_END): Define in just one way.
* libguile/async.c (critical_section_mutex): New static variable.
  (scm_critical_section_start, scm_critical_section_end): Inline
  internal body of critical section gates.
  (scm_init_async): Init critical_section_mutex.
* libguile/threads.c (scm_threads_prehistory): Don't declare critical
  section mutex here.
This commit is contained in:
Andy Wingo 2016-11-01 22:48:19 +01:00
parent c88d0cc402
commit b410667e64
3 changed files with 12 additions and 42 deletions

View file

@ -1939,10 +1939,6 @@ static scm_i_pthread_cond_t wake_up_cond;
static int threads_initialized_p = 0;
/* This mutex is used by SCM_CRITICAL_SECTION_START/END.
*/
scm_i_pthread_mutex_t scm_i_critical_section_mutex;
static SCM dynwind_critical_section_mutex;
void
@ -1971,8 +1967,6 @@ scm_threads_prehistory (void *base)
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);