((3) 'JOB-CONTROL)
(else (error "Illegal process job-control status:" n)))))
\f
+(define last-global-tick '())
+
(define (handle-subprocess-status-change)
+ (let ((latest-tick (subprocess-global-status-tick)))
+ (if (not (eq? latest-tick last-global-tick))
+ (begin
+ (signal-subprocess-status-change)
+ (set! last-global-tick latest-tick))))
(if (eq? 'NT microcode-id/operating-system)
(for-each (lambda (process)
(if (memq (subprocess-status process) '(EXITED SIGNALLED))
handle-subprocess-status-change)
(export (runtime socket)
handle-subprocess-status-change)
+ (export (runtime thread)
+ handle-subprocess-status-change)
+ (import (runtime thread)
+ signal-subprocess-status-change)
(initialization (initialize-package!)))
(define-package (runtime synchronous-subprocess)
(set! next-scheduled-timeout #f)
(deliver-timer-events)
(maybe-signal-io-thread-events)
+ (maybe-signal-subprocess-status)
(cond ((and (not first-runnable-thread) (not old))
(%maybe-toggle-thread-timer)
(%%trace ";"id" thread-timer: continuing with timer set for "
(vector-ref result 1)
(vector-ref result 2)))
((eq? 'PROCESS-STATUS-CHANGE result)
- (signal-io-thread-events 1
- '#(PROCESS-STATUS-CHANGE)
- '#(READ)))))
+ (handle-subprocess-status-change))))
+
+(define (signal-subprocess-status-change)
+ (%%trace ";"(%%id)" signal-subprocess-status-change\n")
+ (signal-io-thread-events 1 '#(PROCESS-STATUS-CHANGE) '#(READ)))
(define (maybe-signal-io-thread-events)
- (assert-locked 'maybe-signal-io-thread-events)
(%%trace ";"(%%id)" maybe-signal-io-thread-events: testing\n")
+ (assert-locked 'maybe-signal-io-thread-events)
(let ((result (test-select-registry io-registry #f)))
(signal-select-result result)
(%%trace ";"(%%id)" maybe-signal-io-thread-events => "
(if (vector? result) (vector-ref result 0) result)"\n")))
+(define (maybe-signal-subprocess-status)
+ (assert-locked 'maybe-signal-subprocess-status)
+ (%%trace ";"(%%id)" maybe-signal-subprocess-status\n")
+ (handle-subprocess-status-change))
+
(define (block-on-io-descriptor descriptor mode)
(let ((result 'INTERRUPT)
(thread (current-thread)))