\f
(define last-global-tick '())
-(define (handle-subprocess-status-change)
+(define (handle-status-change signaler)
(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))))
+ (signaler)
+ (set! last-global-tick latest-tick)))))
+
+(define (handle-subprocess-status-change)
+ (handle-status-change signal-subprocess-status-change)
(if (eq? 'NT microcode-id/operating-system)
(for-each (lambda (process)
(if (memq (subprocess-status process) '(EXITED SIGNALLED))
(close-subprocess-i/o process)))
(subprocess-list))))
+(define (%handle-subprocess-status-change)
+ (handle-status-change %signal-subprocess-status-change))
+
(define-integrable subprocess-job-control-available?
(ucode-primitive os-job-control? 0))
(export (runtime socket)
handle-subprocess-status-change)
(export (runtime thread)
- handle-subprocess-status-change)
+ %handle-subprocess-status-change)
(import (runtime thread)
+ %signal-subprocess-status-change
signal-subprocess-status-change)
(initialization (initialize-package!)))
(vector-ref result 1)
(vector-ref result 2)))
((eq? 'PROCESS-STATUS-CHANGE result)
- (handle-subprocess-status-change))))
+ (%handle-subprocess-status-change))))
(define (signal-subprocess-status-change)
(%%trace ";"(%%id)" signal-subprocess-status-change\n")
+ (with-threads-locked %signal-subprocess-status-change))
+
+(define (%signal-subprocess-status-change)
+ (%%trace ";"(%%id)" %signal-subprocess-status-change\n")
+ (assert-locked '%signal-subprocess-status-change)
(signal-io-thread-events 1 '#(PROCESS-STATUS-CHANGE) '#(READ)))
(define (maybe-signal-io-thread-events)
(define (maybe-signal-subprocess-status)
(assert-locked 'maybe-signal-subprocess-status)
(%%trace ";"(%%id)" maybe-signal-subprocess-status\n")
- (handle-subprocess-status-change))
+ (%handle-subprocess-status-change))
(define (block-on-io-descriptor descriptor mode)
(let ((result 'INTERRUPT)