tests/runtime/test-gtk spins like crazy again. With a gtk-thread
always ready to run and no thread waiting for io, wait-for-io is never
called and maybe-signal-io-thread-events never blocks. Unfortunately
test-select-registry always returned INTERRUPT for non-blocking
selects with an empty registry. It needs to return PROCESS-STATUS-
CHANGE when there is a pending process status change so that handle-
subprocess-status-change runs. Thus OS_pause got a new argument:
blockp. In uxio.c it can call OS_process_any_status_change and
return PROCESS-STATUS-CHANGE when necessary.
}
int
-OS_pause (void)
+OS_pause (int blockp)
{
/* Wait-for-io must spin. */
return
}
int
-OS_pause (void)
+OS_pause (int blockp)
{
/* Wait-for-io must spin. */
return
(select_registry_t registry, int blockp);
extern int OS_test_select_descriptor
(int fd, int blockp, unsigned int mode);
-extern int OS_pause (void);
+extern int OS_pause (int blockp);
extern select_registry_t arg_select_registry (int arg_number);
#endif /* SCM_OSIO_H */
if ((VECTOR_LENGTH (vmode)) < rl)
error_bad_range_arg (4);
result = ((rl == 0)
- ? (blockp ? (OS_pause ()) : SELECT_INTERRUPT)
+ ? (OS_pause (blockp))
: (OS_test_select_registry (r, blockp)));
if (result > 0)
{
#endif /* not HAVE_POLL */
-int
-OS_pause (void)
+static int
+safe_pause (void)
{
#ifdef HAVE_SIGSUSPEND
sigset_t old, new;
: SELECT_INTERRUPT);
#endif
}
+
+int
+OS_pause (int blockp)
+{
+ if (!blockp)
+ {
+ return ((OS_process_any_status_change ())
+ ? SELECT_PROCESS_STATUS_CHANGE
+ : SELECT_INTERRUPT);
+ }
+ else
+ return (safe_pause ());
+}