Re: [racket-users] Creating threads that prevent main thread from exiting

2020-11-16 Thread Matthew Flatt
Probably the right choice is to install a flush handler with the current plumber: (define (thread/wait proc) (define t (thread proc)) (plumber-add-flush! (current-plumber) (lambda (h) (thread-wait t))) t) That adds a `thread-wait` in the same sense as flushing a

[racket-users] Creating threads that prevent main thread from exiting

2020-11-16 Thread Greg Rosenblatt
What is the best way to create threads that will prevent a program from exiting until they have completed their work? I'd like to be able to do this implicitly, without cooperation from the main thread. My first experiment uses `shift` to insert uses of `thread-wait` after the rest of the