Skip to content

Commit d74263d

Browse files
committed
Adding guard
1 parent c260458 commit d74263d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ext/socket/socket-selector.incl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* mode:c */
1+
/* -*- mode:c -*- */
22
static int selector_sockets(SgSocketSelector *selector)
33
{
44
/* filter closed socket */

sitelib/util/concurrent/actor.scm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@
100100
actor)
101101

102102
(define (actor-interrupt! actor)
103-
(and (actor-running? actor)
104-
(thread-interrupt! (actor-thread actor))))
103+
;; if the actor already stopped, thread-interrrupt! signals an error
104+
(guard (e (else #t))
105+
(and (actor-running? actor)
106+
(thread-interrupt! (actor-thread actor)))))
105107

106108
(define (actor-running? actor) (eq? (actor-state actor) 'running))
107109

0 commit comments

Comments
 (0)