Michael Hughes added the comment:
Given that this is from five years ago, and I've moved on, I honestly can't say
I care too deeply about this.
My use case was for handling threads:
* created by inexperienced python programmers that don't know about daemons
* using third party
Michael Hughes added the comment:
Hey guys
We don't always have control over all of the threads launched within our
application. We might have inexperienced users writing basic scripts using
threads, but they don't know enough about setting them to Daemon. Previous
versions of
Michael Hughes added the comment:
To use the callback, you can do this:
import threading
def threadendcallback():
# return False to indicate that we don't
# want to wait for any threads before exiting
return False
threading.currentThread().waitForThreadsOnExitFunc = threadendcal
Changes by Michael Hughes :
Removed file: http://bugs.python.org/file19625/threadingchange.patch
___
Python tracker
<http://bugs.python.org/issue10444>
___
___
Python-bug
Michael Hughes added the comment:
Scratch that last patch. It was missing part of the fix.
I've removed the old patch now, and submitted the proper one.
--
Added file: http://bugs.python.org/file19626/real.patch
___
Python tracker
Michael Hughes added the comment:
I have a patch here.
It is to allow for a callback to be set on the main thread which gets called
when there are non-daemon threads still alive on exit.
The callback returns True or False indicating whether or not it wants to block.
By default, the whole
New submission from Michael Hughes :
We use the Python interpreter embedded in our application, and would prefer to
not block an exit of our application waiting for non-daemon threads to finish.
I would like a mechanism exposed that queries for whether or not to wait.
--
components