[racket-dev] [plt] Push #24082: master branch updated
On 03/22/2012 03:27 PM, Jay McCarthy wrote:
> Someone else noticed this warning.
>
> http://bugs.racket-lang.org/query/?cmd=view&pr=12443
>
> As the comment below mentions, I don't actually know how to get rid of
> the warning, but it doesn't cause problems anymore.
>
> Does anyone have any ideas or thoughts?
Based on my testing, the call to 'thread' that sometimes fails is the
one labeled "Clean-up and timeout thread". My guess is that the handler
thread (the one that calls 'handler') ends by calling
'custodian-shutdown-all' on its current custodian ('c'), and
occasionally that shutdown occurs before the cleanup thread is even created.
One way to fix it is to delay the handler thread's execution until the
cleanup thread has been created (eg, have the handler thread wait on a
semaphore that isn't posted until after the cleanup thread is created).
Another way would be to create the cleanup thread first, but that
requires both synchronization and mutation, because it needs to refer to
the handler thread.
Ryan