Skip to content

Commit

Permalink
consolidate use of make-EXIT-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
owaddell-beckman committed Mar 8, 2024
1 parent 17d46cf commit a2ba260
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/swish/erlang.ss
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,15 @@
(let ([reason (unwrap-fault-condition raw-reason)])
(cond
[(eq? reason 'kill) (@kill p 'killed)]
[(pcb-trap-exit p) (@send p (make-EXIT-msg self raw-reason))]
[(pcb-trap-exit p) (@send-EXIT p self raw-reason)]
[(not (eq? reason 'normal)) (@kill p raw-reason)]))
(unless (alive? self)
(yield #f 0))))
#t)

(define (@send-EXIT target-pid exit-pid exit-reason)
(@send target-pid (make-EXIT-msg exit-pid exit-reason)))

(define (keyboard-interrupt p)
(unless (pcb? p)
(bad-arg 'keyboard-interrupt p))
Expand Down Expand Up @@ -404,7 +407,7 @@
(cond
[(alive? p) (@link p self)]
[(pcb-trap-exit self)
(@send self (make-EXIT-msg p (pcb-exception-state p)))]
(@send-EXIT self p (pcb-exception-state p))]
[else
(let ([r (pcb-exception-state p)])
(unless (eq? (unwrap-fault-condition r) 'normal)
Expand Down Expand Up @@ -942,7 +945,7 @@
(let ([linked (car links)])
(cond
[(not (alive? linked))]
[(pcb-trap-exit linked) (@send linked (make-EXIT-msg p raw-reason))]
[(pcb-trap-exit linked) (@send-EXIT linked p raw-reason)]
[(not (eq? reason 'normal)) (@kill linked raw-reason)]))
(@kill-linked (cdr links) p reason raw-reason)))

Expand Down

0 comments on commit a2ba260

Please sign in to comment.