Skip to content

Commit

Permalink
Fix for poll-or-spawn: the monitoring thread must die.
Browse files Browse the repository at this point in the history
  • Loading branch information
dyoo committed Apr 22, 2013
1 parent b6bd86f commit 6547d18
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions collects/racket/port.rkt
Expand Up @@ -1114,15 +1114,18 @@
(lambda (nack)
(define ch (make-channel))
(define ready (make-semaphore))
(let ([t (thread (lambda ()
(letrec ([t1 (thread (lambda ()
(parameterize-break #t
(with-handlers ([exn:break? void])
(semaphore-post ready)
(go nack ch #f)))))])
(thread (lambda ()
(sync nack)
(semaphore-wait ready)
(break-thread t))))
(go nack ch #f)
(kill-thread t2)))))]

[t2 (thread (lambda ()
(sync nack)
(semaphore-wait ready)
(break-thread t1)))])
(void))
ch))))))

(define (read-at-least-bytes!-evt orig-bstr input-port need-more? shrink combo
Expand Down

0 comments on commit 6547d18

Please sign in to comment.