403 |
scm_async_click (); \ |
scm_async_click (); \ |
404 |
} while (0) |
} while (0) |
405 |
|
|
|
#if (SCM_DEBUG_INTERRUPTS == 1) |
|
|
#include <stdio.h> |
|
|
#define SCM_CHECK_NOT_DISABLED \ |
|
|
do { \ |
|
|
if (scm_ints_disabled) \ |
|
|
fprintf(stderr, "ints already disabled (at %s:%d)\n", \ |
|
|
__FILE__, __LINE__); \ |
|
|
} while (0) |
|
|
|
|
|
#define SCM_CHECK_NOT_ENABLED \ |
|
|
do { \ |
|
|
if (!scm_ints_disabled) \ |
|
|
fprintf(stderr, "ints already enabled (at %s:%d)\n", \ |
|
|
__FILE__, __LINE__); \ |
|
|
} while (0) |
|
|
|
|
|
#else |
|
|
#define SCM_CHECK_NOT_DISABLED |
|
|
#define SCM_CHECK_NOT_ENABLED |
|
|
#endif |
|
|
|
|
406 |
|
|
407 |
/* Anthony Green writes: |
/* Anthony Green writes: |
408 |
When the compiler sees... |
When the compiler sees... |
425 |
#define SCM_FENCE |
#define SCM_FENCE |
426 |
#endif |
#endif |
427 |
|
|
428 |
#define SCM_DEFER_INTS \ |
#define SCM_DEFER_INTS SCM_REC_CRITICAL_SECTION_START (scm_i_defer) |
|
do { \ |
|
|
SCM_FENCE; \ |
|
|
SCM_CHECK_NOT_DISABLED; \ |
|
|
SCM_REC_CRITICAL_SECTION_START (scm_i_defer); \ |
|
|
SCM_FENCE; \ |
|
|
scm_ints_disabled = 1; \ |
|
|
SCM_FENCE; \ |
|
|
} while (0) |
|
|
|
|
|
|
|
|
#define SCM_ALLOW_INTS \ |
|
|
do { \ |
|
|
SCM_FENCE; \ |
|
|
SCM_CHECK_NOT_ENABLED; \ |
|
|
SCM_REC_CRITICAL_SECTION_END (scm_i_defer); \ |
|
|
SCM_FENCE; \ |
|
|
scm_ints_disabled = 0; \ |
|
|
SCM_FENCE; \ |
|
|
SCM_THREAD_SWITCHING_CODE; \ |
|
|
SCM_FENCE; \ |
|
|
} while (0) |
|
|
|
|
|
|
|
|
#define SCM_REDEFER_INTS \ |
|
|
do { \ |
|
|
SCM_FENCE; \ |
|
|
SCM_REC_CRITICAL_SECTION_START (scm_i_defer); \ |
|
|
++scm_ints_disabled; \ |
|
|
SCM_FENCE; \ |
|
|
} while (0) |
|
429 |
|
|
430 |
|
#define SCM_ALLOW_INTS SCM_REC_CRITICAL_SECTION_END (scm_i_defer) |
431 |
|
|
432 |
#define SCM_REALLOW_INTS \ |
#define SCM_REDEFER_INTS SCM_DEFER_INTS |
|
do { \ |
|
|
SCM_FENCE; \ |
|
|
SCM_REC_CRITICAL_SECTION_END (scm_i_defer); \ |
|
|
SCM_FENCE; \ |
|
|
--scm_ints_disabled; \ |
|
|
SCM_FENCE; \ |
|
|
} while (0) |
|
433 |
|
|
434 |
|
#define SCM_REALLOW_INTS SCM_ALLOW_INTS |
435 |
|
|
436 |
#define SCM_TICK \ |
#define SCM_TICK \ |
437 |
do { \ |
do { \ |