(ring/discard-all (thread/pending-events thread))
(%deregister-io-thread-events thread)
(%discard-thread-timer-records thread)
+ (%deregister-gc-event thread)
(%deregister-subprocess-events thread)
(%disassociate-joined-threads thread)
(%disassociate-thread-mutexes thread)
(define (maybe-signal-io-thread-events)
(%assert-locked 'maybe-signal-io-thread-events)
(if (or io-registrations
- (registered-subprocesses-running?))
+ subprocess-registrations)
(signal-select-result (test-select-registry io-registry #f))))
-(define-integrable (registered-subprocesses-running?)
- (find (lambda (registration)
- (eq? 'RUNNING (subprocess-status
- (subprocess-registration/subprocess
- registration))))
- subprocess-registrations))
-
(define (block-on-io-descriptor descriptor mode)
(let ((result 'INTERRUPT)
(registration #f))
(define (deregister-gc-event)
(with-thread-lock
(lambda ()
- (let ((entry (weak-assq (%thread (%id)) gc-events)))
- (if entry
- (set! gc-events (delq! entry gc-events)))))))
+ (%deregister-gc-event (%thread (%id))))))
+
+(define (%deregister-gc-event thread)
+ (%assert-locked '%deregister-gc-event)
+ (let ((entry (weak-assq thread gc-events)))
+ (if entry
+ (set! gc-events (delq! entry gc-events)))))
(define (registered-gc-event)
(with-thread-lock
(ring/discard-all (thread/pending-events thread))
(%deregister-io-thread-events thread)
(%discard-thread-timer-records thread)
+ (%deregister-gc-event thread)
(%deregister-subprocess-events thread)
(set-thread/block-events?! thread block-events?))
(%maybe-toggle-thread-timer))))
((and consider-non-timers?
timer-interval
(or io-registrations
- (registered-subprocesses-running?)
+ subprocess-registrations
first-runnable-thread))
(start (+ now timer-interval)))
(else