[Zope3-checkins]
SVN: Zope3/branches/3.2/src/zope/app/twisted/asyncore_main_loop.py
Use thread,
rather than threading to avoid spurious messages on exit.
Jim Fulton
jim at zope.com
Tue Dec 20 10:56:38 EST 2005
Log message for revision 40909:
Use thread, rather than threading to avoid spurious messages on exit.
See comment in code.
Changed:
U Zope3/branches/3.2/src/zope/app/twisted/asyncore_main_loop.py
-=-
Modified: Zope3/branches/3.2/src/zope/app/twisted/asyncore_main_loop.py
===================================================================
--- Zope3/branches/3.2/src/zope/app/twisted/asyncore_main_loop.py 2005-12-20 15:22:24 UTC (rev 40908)
+++ Zope3/branches/3.2/src/zope/app/twisted/asyncore_main_loop.py 2005-12-20 15:56:38 UTC (rev 40909)
@@ -68,8 +68,16 @@
import logging
import sys
-import threading
+# We're using thread, rather than threading because there seem to be
+# some end-of-process cleanup problems with the threading module that
+# cause weird unhelpful messages to get written to standard error
+# intermittently when Python is exiting. We'll leave the old threading
+# code around in case it's helpful later.
+
+## import threading
+import thread
+
import ThreadedAsync
logger = logging.getLogger('ZEO.twisted')
@@ -97,11 +105,13 @@
pass
def run_in_thread(reactor):
- thread = threading.Thread(
- target=run,
- args=(reactor, ),
- )
- thread.setDaemon(True)
- thread.start()
+# see note above
+## thread = threading.Thread(
+## target=run,
+## args=(reactor, ),
+## )
+## thread.setDaemon(True)
+## thread.start()
+ thread.start_new_thread(run, (reactor, ))
More information about the Zope3-Checkins
mailing list