diff --git a/knots/thread-pool.scm b/knots/thread-pool.scm index 70d7292..49572db 100644 --- a/knots/thread-pool.scm +++ b/knots/thread-pool.scm @@ -269,7 +269,7 @@ from there, or #f if that would be an empty string." (sleep 1) (destructor/safe args))))) - (define (process channel args) + (define (process thread-index channel args) (let loop () (match (get-message channel) ('destroy #f) @@ -292,6 +292,9 @@ from there, or #f if that would be an empty string." internal-time-units-per-second) exn)) (lambda () + (vector-set! thread-proc-vector + thread-index + proc) (with-exception-handler (lambda (exn) (let ((stack @@ -319,6 +322,10 @@ from there, or #f if that would be an empty string." vals)))))) #:unwind? #t))) + (vector-set! thread-proc-vector + thread-index + #f) + (put-message reply response) @@ -358,7 +365,7 @@ from there, or #f if that would be an empty string." "knots: thread-pool: internal exception: ~A\n" exn)) (lambda () (parameterize ((param args)) - (process channel args))) + (process index channel args))) #:unwind? #t))) (when thread-destructor