(%maybe-toggle-thread-timer))))
(define (deregister-io-descriptor descriptor close-descriptor!)
- (with-thread-lock
- (lambda ()
- (%deregister-io-descriptor* descriptor)
- (close-descriptor!))))
-
-(define (%deregister-io-descriptor* descriptor)
+ (let ((error?
+ (with-thread-lock
+ (lambda ()
+ (%deregister-io-descriptor descriptor)
+ (ignore-errors
+ (lambda ()
+ (close-descriptor!)
+ #f))))))
+ (if error?
+ (signal-condition error?))))
+
+(define (%deregister-io-descriptor descriptor)
(let dloop ((dentry io-registrations))
(cond ((not dentry)
unspecific)
(delq! registration subprocess-registrations)))))
(define (deregister-subprocess subprocess delete-subprocess!)
- (with-thread-lock
- (lambda ()
- (set! subprocess-registrations
- (filter!
- (lambda (registration)
- (not (eq? subprocess
- (subprocess-registration/subprocess registration))))
- subprocess-registrations))
- (delete-subprocess!))))
+ (let ((error?
+ (with-thread-lock
+ (lambda ()
+ (set! subprocess-registrations
+ (filter!
+ (lambda (registration)
+ (not (eq? subprocess (subprocess-registration/subprocess
+ registration))))
+ subprocess-registrations))
+ (ignore-errors
+ (lambda ()
+ (delete-subprocess!)
+ #f))))))
+ (if error?
+ (signal-condition error?))))
(define (%deregister-subprocess-events thread)
(%assert-locked '%deregister-subprocess-events)