[racket] adding other objects to custodian

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sat Jul 3 22:03:33 EDT 2010

I want to be sure that a host OS subprocess created with "subprocess" is 
killed when thread of my program in which it was created terminates.

Currently, I create a custodian for the thread and explicitly call 
"custodian-shutdown-all" at the end of the thread's lifetime (in a 
"dynamic-wind" cleanup thunk).

Ideally, I would like to use this same custodian to kill the subprocess, 
but I do not see how.  "make-custodian-box" does not seem to involve 
"custodian-shutdown-all" evaluating a closure in the box or executing a 
will.

If using the current custodian is not possible, then I think I have to 
do something like make a will executor and execute it from my 
"dynamic-wind" cleanup thunk.

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.