static SchemeSource * scheme_source = NULL;
static gboolean tracing_gtk_select = 0;
static void trace (const char *format, ...);
+static gboolean interrupt_p (void);
static GSList * gtk_registry (select_registry_t registry);
static int slice_counter = 0;
va_end (args);
}
+static gboolean
+interrupt_p (void)
+{
+ /* Ignores the INT_MASK, which is interrupt-mask/gc-ok per
+ call-alien. That mask keeps callbacks from wandering onto other
+ threads. Ignoring it allows the scheme_source to return to the
+ gtk-thread, where call-alien will restore gtk-thread's mask,
+ unmasking whatever interrupt was pending (assuming gtk-thread
+ runs with all interrupts unmasked). */
+
+ /* return (INTERRUPT_PENDING_P (INT_Mask)); */
+ /* return (((PENDING_INTERRUPTS ()) & (INT_Mask)) != 0); */
+ /* return ((((GET_INT_MASK & GET_INT_CODE)) & (INT_Mask)) != 0); */
+ return (GET_INT_CODE);
+}
+
static gboolean
scheme_source_prepare (GSource * source, gint * timeout)
{
SchemeSource * src = (SchemeSource *)source;
if (src->runnable
- || pending_interrupts_p ()
+ || interrupt_p ()
|| OS_process_any_status_change ())
{
trace (";scheme_source_prepare: ready (%s)\n",
src->runnable ? "thread"
- : pending_interrupts_p () ? "interrupt"
+ : interrupt_p () ? "interrupt"
: "subprocess");
*timeout = 0;
return (TRUE);
if (src->time_limit == 0.0
|| src->runnable
- || pending_interrupts_p ()
+ || interrupt_p ()
|| OS_process_any_status_change ()
|| pending_io (src))
{
trace (";scheme_source_check: ready (%s)\n",
src->runnable ? "thread"
- : pending_interrupts_p () ? "interrupt"
+ : interrupt_p () ? "interrupt"
: OS_process_any_status_change () ? "subprocess"
: src->time_limit == 0.0 ? "" : "i/o");
return (TRUE);