Skip to content

Commit

Permalink
Fix %make-joiner
Browse files Browse the repository at this point in the history
  • Loading branch information
shirok committed Jan 11, 2025
1 parent a2980c2 commit ba7e04c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/control/pmap.scm
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@

(define join-exc (make-parameter #f))

;; Creates a wrapped thread-join!. It works like thread-join!, except
;; when thread-join! throws an error, catch it and returns R. If the
;; error is not a terminated-thread-exception, record it in join-exc.
(define (%make-joiner r)
(^[thread :optional (timeout #f) (timeout-val #f)]
(guard (e [(terminated-thread-exception? e) r]
[else (join-exc e) '()])
[else (join-exc e) r])
(thread-join! thread timeout timeout-val))))

(define-syntax %with-wrapped-join
Expand Down

0 comments on commit ba7e04c

Please sign in to comment.