summaryrefslogtreecommitdiff
path: root/libguile/__scm.h
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/__scm.h')
-rw-r--r--libguile/__scm.h61
1 files changed, 2 insertions, 59 deletions
diff --git a/libguile/__scm.h b/libguile/__scm.h
index 187ada5a0..0ce844ad5 100644
--- a/libguile/__scm.h
+++ b/libguile/__scm.h
@@ -425,9 +425,9 @@ do { \
#define SCM_FENCE
#endif
-#define SCM_DEFER_INTS SCM_REC_CRITICAL_SECTION_START (scm_i_defer)
+#define SCM_DEFER_INTS scm_rec_mutex_lock (&scm_i_defer_mutex);
-#define SCM_ALLOW_INTS SCM_REC_CRITICAL_SECTION_END (scm_i_defer)
+#define SCM_ALLOW_INTS scm_rec_mutex_unlock (&scm_i_defer_mutex);
#define SCM_REDEFER_INTS SCM_DEFER_INTS
@@ -441,63 +441,6 @@ do { \
-/* Critical sections */
-
-#define SCM_DECLARE_NONREC_CRITICAL_SECTION(prefix) \
- extern scm_t_mutex prefix ## _mutex
-
-#define SCM_NONREC_CRITICAL_SECTION_START(prefix) \
- do { scm_thread *t = scm_i_leave_guile (); \
- scm_i_plugin_mutex_lock (&prefix ## _mutex); \
- scm_i_enter_guile (t); \
- } while (0)
-
-#define SCM_NONREC_CRITICAL_SECTION_END(prefix) \
- do { scm_i_plugin_mutex_unlock (&prefix ## _mutex); \
- } while (0)
-
-/* This could be replaced by a single call to scm_i_plugin_mutex_lock
- on systems which support recursive mutecis (like LinuxThreads).
- We should test for the presence of recursive mutecis in
- configure.in.
-
- Also, it is probably possible to replace recursive sections with
- non-recursive ones, so don't worry about the complexity.
- */
-
-#define SCM_DECLARE_REC_CRITICAL_SECTION(prefix) \
- extern scm_t_mutex prefix ## _mutex; \
- extern int prefix ## _count; \
- extern scm_thread *prefix ## _owner
-
-#define SCM_REC_CRITICAL_SECTION_START(prefix) \
- do { scm_i_plugin_mutex_lock (&scm_i_section_mutex); \
- if (prefix ## _count && prefix ## _owner == SCM_CURRENT_THREAD) \
- { \
- ++prefix ## _count; \
- scm_i_plugin_mutex_unlock (&scm_i_section_mutex); \
- } \
- else \
- { \
- scm_thread *t = scm_i_leave_guile (); \
- scm_i_plugin_mutex_unlock (&scm_i_section_mutex); \
- scm_i_plugin_mutex_lock (&prefix ## _mutex); \
- prefix ## _count = 1; \
- prefix ## _owner = t; \
- scm_i_enter_guile (t); \
- } \
- } while (0)
-
-#define SCM_REC_CRITICAL_SECTION_END(prefix) \
- do { scm_i_plugin_mutex_lock (&scm_i_section_mutex); \
- if (!--prefix ## _count) \
- { \
- prefix ## _owner = 0; \
- scm_i_plugin_mutex_unlock (&prefix ## _mutex); \
- } \
- scm_i_plugin_mutex_unlock (&scm_i_section_mutex); \
- } while (0)
-
/* Note: The following needs updating. */
/* Classification of critical sections